elm-lang/elm-platform

0.18 Breaks Elm Reactor

Kwarrtz opened this issue ยท 11 comments

I just updated to Elm 0.18.0, and the reactor stopped working correctly for me. The menus work fine, but when I go to actually run the program it simply displays a blank screen. The JS console shows two errors:

Uncaught TypeError: Cannot read property 'nativeBinding' of undefined
Uncaught TypeError: runElmProgram is not a function

The issue is very similar (almost identical) to issue 688 on elm-core, but this time deleting the elm-stuff/ directory does not solve the issue.

I'm running Chrome v56 on macOS Sierra.

Thanks for the issue! 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.

When you run which elm-make what do you get? When you say elm-make --help what version does it show? Can you share elm-stuff/exact-dependencies.json? It seems like a configuration thing.

elm-make is installed as /usr/local/bin/elm-make. elm-make --help tells me that I am running v0.18, as expected. exact-dependencies.json contains:

{
    "elm-lang/virtual-dom": "2.0.1",
    "elm-lang/html": "2.0.0",
    "elm-lang/svg": "2.0.0",
    "elm-lang/core": "5.0.0"
}

I agree that this does seem like a configuration issue, since I seem to be the only person encountering it. However, my elm install is essentially stock, so I'm not sure what would be causing the problem. I'm doubly suspicious since I've run into basically this same problem on two different projects using two different Elm installs now.

I'll also add that when I elm make the project it works fine. It's only when I try to run it through the reactor that I have difficulty.

I am having the same issue with elm-reactor after upgrading to 0.18.
The version of my elm-make is 0.18.

If this helps, my exact-dependencies.json is as follows.

{
    "elm-lang/virtual-dom": "2.0.1",
    "elm-lang/html": "2.0.0",
    "elm-lang/core": "5.0.0"
}

Elm-make works for me as well, The issue only occurs with elm-reactor.

Did you use the alpha or beta versions? You may want to try deleting the ~/.elm/ directory as well.

Deleting ~/.elm does not solve the issue. I'm not entirely certain whether or not I am on the alpha or beta versions. But, considering that I only downloaded the installer for 0.18 a few days ago (the day before I opened this issue) and that elm --version returns 0.18.0 without any additional modifiers, I assume that I'm running the stable version.

Try to make an http://sscce.org/ of the program you are trying to run. What's the actual code? Do the examples from http://elm-lang.org/examples work?

@Kwarrtz Not sure if this applies to you, but you can get this message if you use Html.beginnerProgram (possibly Html.program too; I haven't tried it) with an identifier other than main.

For example, If you do:

potatoFarm =
  Html.beginnerProgram {...}

You will get Uncaught TypeError: runElmProgram is not a function at runtime.

Renaming the top level identifier fixed this issue for me:

main =
  Html.beginnerProgram {...}

Maybe this should have been obvious to me but it wasn't. I thought it was config and tried elm-make, double-checking exact-dependencies and elm-package and a few other things before going line by line through the code to see what I had different from the examples.

Cannot fix this without an http://sscce.org

Please open a new issue if you can get a minimal example that reproduces the problem.

tgelu commented

@SimplGy - Thanks a lot! Wasted a lot of time until I realized that. Maybe this should be explicit somewhere? @evancz

tj commented

Weird, I hit this as well after upgrading to 0.18.0 (haven't tried Elm in months now). Skipping elm package install and just letting elm-reactor fetch seemed to fix runElmProgram is not a function for me, even though exact-dependencies.json looks the same. I can't reproduce now that it's working though.