elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

Error when updating elm-lang/virtual-dom from 2.0.1 to 2.0.2 #133

Open mulander opened 7 years ago

mulander commented 7 years ago

Minor version bump in elm-lang/virtual-dom causes elm-make to fail building a project with the error:

Map.!: given key is not an element in the map

Apparently someone reported the exact same problem on the mailing list: https://groups.google.com/forum/#!topic/elm-discuss/cN0GFZpw_b0

Here is a transcript from my project:

$ elm-make --debug --warn src/Koparo.elm --output=web/js/koparo.js                                                                     
Success! Compiled 0 modules.                                                                                                           
Successfully generated web/js/koparo.js 
$ cat elm-package.json
{
    "version": "1.0.0",
    "summary": "...",
    "repository": "https://github.com/user/project.git",
    "license": "proprietary",
    "source-directories": [
        "src"
    ],
    "exposed-modules": [],
    "dependencies": {
        "NoRedInk/elm-decode-pipeline": "3.0.0 <= v < 4.0.0",
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "1.0.0 <= v < 2.0.0",
        "elm-lang/navigation": "2.0.1 <= v < 3.0.0",
        "evancz/url-parser": "2.0.1 <= v < 3.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}
$ elm package install
Some new packages are needed. Here is the upgrade plan.

  Upgrade:
    elm-lang/virtual-dom (2.0.1 => 2.0.2)

Do you approve of this plan? [Y/n] Y
Starting downloads...

  _ elm-lang/virtual-dom 2.0.2

Packages configured successfully!
$ elm-make --debug --warn src/Koparo.elm --output=web/js/koparo.js
elm-make: Map.!: given key is not an element in the map
$ elm --version
0.18.0
$ sysctl kern.version
kern.version=OpenBSD 6.0-current (GENERIC.MP) #0: Mon Nov 14 12:16:34 MST 2016
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal libra

as noted in the email thread - nuking the elm-stuff folder leads to a fully working build again (after elm package install of course).

process-bot commented 7 years ago

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.

jerith666 commented 7 years ago

The same issue was also reported as https://github.com/elm-lang/elm-package/issues/254.

hillaryan commented 7 years ago

Ran into this too. Deleting elm-stuff and rebuilding worked for me.

ghost commented 7 years ago

This is a minor annoyance, but I suspect it affects a lot of people. It is easy to reproduce. I am not sure if this hasn't been addressed yet because of the complexity of regression testing a fix, or because no one has looked into this issue yet.

purcell commented 6 years ago

This happens all the time for us right now, particularly on Travis while running elm-test (and therefore elm-make).

I suspect it might be correlated with a high number of available cores. For people experiencing this, I wonder if it would ever happen for you when running elm-make like GHCRTS=-N1 elm-make... (Having cleared out the elm-stuff directory, of course.)