Open ryan-haskell opened 7 years ago
Thanks for the pull request! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
Repo with issue: https://github.com/RyanNHG/first-electron-app
A workaround is shown here: https://github.com/mdgriffith/elm-electron-todomvc/blob/master/index.html
Where the line window.Elm = require('./elm.js')
is used to make the Elm
object globally available.
Choose your own adventure:
this.Elm
to elm-make
!"window.Elm = require('./elm.js')
to the guide for people using electron!"Let me know what you think.
Heyo Evan
I was trying to use Elm in an Electron app and I ran into a weird error where the
Elm
variable was not defined.I followed the tutorial at https://guide.elm-lang.org/interop/javascript.html like a noob.
Changing the generated file from
var Elm = {}
tothis.Elm = {}
gave me access to the variable, and my problems were resolved.Likely, I goofed something up, but it's possible I finally made a contribution to Elm, and "wrote my first line" of Haskell code.
I'll attach a link to the repo so you can easily replicate the error.