Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError #13

Open
Tamriel opened this issue Jan 19, 2017 · 2 comments
Open

TypeError #13

Tamriel opened this issue Jan 19, 2017 · 2 comments

Comments

@Tamriel
Copy link
Contributor

Tamriel commented Jan 19, 2017

I get

TypeError: $m_Lcom_scalawarrior_scalajs_ace_package$(...).ace__Lcom_scalawarrior_scalajs_ace_Ace(...) is undefined

when using your example code

import com.scalawarrior.scalajs.ace._

val editor = ace.edit("editor")
@Tamriel
Copy link
Contributor Author

Tamriel commented Jan 24, 2017

When I click on the error the browser shows the full Javascript line: $m_Lcom_scalawarrior_scalajs_ace_package$().ace__Lcom_scalawarrior_scalajs_ace_Ace().edit("editor").
I forked the official Scala.js tutorial and added ace. Just clone and have a look yourself (at the branch 'ace'). It would be really great if you take a look! :-)

@facundoq
Copy link

@Tamriel Your problem is that you haven't included the JS code. Add, say:

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.6/ace.js"></script>

to your HTML and the code will work. Make sure you give the containing element a size before calling ace.edit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants