Hi, I just bumped into a compilation error. I've tried to remove elm-stuff and recompile but nothing changed.
Here is the full traceback:
20:53:28 webpack.1 | ERROR in ./app/javascript/SignUp.elm
20:53:28 webpack.1 | Module build failed: Error: Compiler process exited with error Compilation failed
20:53:28 webpack.1 | Dependencies loaded from local cache.
Dependencies ready! ndencies...
Success! Compiled 5 modules.
20:53:28 webpack.1 | elm: Map.!: given key is not an element in the map
20:53:28 webpack.1 | CallStack (from HasCallStack):
20:53:28 webpack.1 | error, called at libraries/containers/Data/Map/Internal.hs:603:17 in containers-0.5.10.2:Data.Map.Internal
20:53:28 webpack.1 |
20:53:28 webpack.1 | at ChildProcess.<anonymous> (/Users/ngw/directory/node_modules/node-elm-compiler/index.js:149:27)
20:53:28 webpack.1 | at ChildProcess.emit (events.js:182:13)
20:53:28 webpack.1 | at maybeClose (internal/child_process.js:961:16)
20:53:28 webpack.1 | at Socket.stream.socket.on (internal/child_process.js:380:11)
20:53:28 webpack.1 | at Socket.emit (events.js:182:13)
20:53:28 webpack.1 | at Pipe._handle.close (net.js:599:12)
20:53:28 webpack.1 | @ ./app/javascript/packs/sign_up.js 1:0-28
20:53:28 webpack.1 | @ multi (webpack)-dev-server/client?http://localhost:3035 ./app/javascript/packs/sign_up.js
20:53:28 webpack.1 | webpack: Failed to compile.
This is my elm.json
{
"type": "application",
"source-directories": [
"app/javascript"
],
"elm-version": "0.19.0",
"dependencies": {
"direct": {
"dillonkearns/elm-graphql": "1.1.0",
"elm/browser": "1.0.0",
"elm/core": "1.0.0",
"elm/html": "1.0.0",
"elm/json": "1.0.0",
"etaque/elm-form": "4.0.0"
},
"indirect": {
"elm/http": "1.0.0",
"elm/random": "1.0.0",
"elm/regex": "1.0.0",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.0",
"elm-community/list-extra": "8.0.0",
"elm-explorations/test": "1.1.0",
"lukewestby/elm-string-interpolate": "1.0.3"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
This is the whole program, which is around 200 LOCs
https://gist.github.com/ngw/d4e94c37738f0e7551b78d5831cc9c99
What does Form.Msg look like?
I've seen that error when the Msg type has either an Array or an Attribute msg
Pretty sure Form.Msg is here: https://github.com/etaque/elm-form/blob/master/src/Form.elm
I'm sorry if this is kinda derailing, but I seem to be having a similar problem. Deleting elm-stuff also doesn't fix it. Unfortunately, I don't have as small of a project: https://gitlab.com/gumbyscout/cosplay/merge_requests/6
./src/elm/Main.elm
Success! Compiled 1 module.
elm: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
error, called at ./Data/Map/Internal.hs:610:17 in containers-0.5.11.0-K2TDqgYtGUcKxAY1UqVZ3R:Data.Map.Internal
{
"type": "application",
"source-directories": ["src/elm"],
"elm-version": "0.19.0",
"dependencies": {
"direct": {
"cuducos/elm-format-number": "6.0.2",
"elm/browser": "1.0.0",
"elm/core": "1.0.0",
"elm/html": "1.0.0",
"elm/json": "1.0.0",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"krisajenkins/remotedata": "5.0.0",
"CurrySoftware/elm-datepicker": "2.1.0"
},
"indirect": {
"elm/http": "1.0.0",
"elm/parser": "1.1.0",
"justinmimbs/date": "2.0.2",
"elm/virtual-dom": "1.0.0",
"myrho/elm-round": "1.0.4"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
This needs to be trimmed down into an http://sscce.org/ and turned into a new issue.
Start taking out functions and dependencies until nothing can be taken out anymore. This will make it much easier to pin down the root issue on my side.
This is happening for me as well. I don't have time to make an sscce right now (will post back when I can), but the information that I can add: it's happening with elm 0.19 on macOS 10.12.6 and deleting elm-stuff does not help.
Also why is this closed? Can we keep it open until the problem is fixed?
UPDATE: I was able to locate the code that's tripping up the compiler in my app but when I isolate just that code and run it in a test app everything compiles fine, so I'm not able to create an sscce. This may or may not be helpful but here's my situation:
I have a type alias that defines API requests that looks like this:
type alias Request =
{ method : String
, endpoint : String
, body : Http.Body
, query : Query
, retry : Bool
}
I recently added the body field which is when the compiler started breaking with the following error:
ERROR in ./src/Main.elm
Module build failed: Error: Compiler process exited with error Compilation failed
Success! Compiled 5 modules.
elm: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
error, called at libraries/containers/Data/Map/Internal.hs:603:17 in containers-0.5.10.2:Data.Map.Internal
at ChildProcess.<anonymous> (/Users/elliotdi/Dropbox/dev/budget-ui/node_modules/node-elm-compiler/index.js:149:27)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Socket.stream.socket.on (internal/child_process.js:348:11)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at Pipe._handle.close [as _onclose] (net.js:545:12)
@ ./index.js 1:0-36
@ multi (webpack)-dev-server/client?http://localhost:3000 ./index.js
If I change the body field to be of type String the compiler starts working again and I get the following errors that confirm I'm using the field correctly elsewhere in my app (I'm currently just assigning Http.emptyBody to it in a couple places):
The body is a record of type:
{ body : Http.Body
, endpoint : String
, method : String
, query : List ( String, String )
, retry : Bool
}
But the type annotation on `post` says it should be:
Request
I removed the body field from the type alias and the references to it elsewhere in the app and everything started building again. I tried creating an isolated test case with a very simple app that included a similar type alias, but the compiler had no trouble with it. Not sure where to go from here, but I hope this helps.
When you have a large project with a decent amount of activity on GitHub, keeping issues open that do not have a clear http://sscce.org/ leads to long term problems. Lots of clutter. Hard to fix things.
The point of an http://sscce.org/ is for people to work on their own or with other community members to get the issue down as small as possible. This will reveal either (1) that it is not a compiler issue or (2) that it is a much more specific issue. Either way, the overall time allocation for fixing things is much more efficient.
When you read the link about what an http://sscce.org/ is, one thing it mentions is that it is the smallest piece of code that still exhibits the bug. If you can get your example down to an http://sscce.org/, please open a new issue with the relevant code.
@evancz alright, thanks for explaining.
Same issue here with 40000 LOC - deleting elm-stuff did not help.
elm make src/Main.elm works, but whatever Webpack does, does not
Same issue here.
only 500 LOC though so this might help? I also think I know which part triggers it.
elm-stuff deletion also does not help.
I uploaded the code here and can give you the extra information that:
It only happens from the moment I added the Animation code, so that means:
- the subscriptions (both in App as in App.Login)
- added a type 'Animation'
- added the App.Login.AnimationStyles
- added the Anmiation msg
- added handling of that msg in the App.Login.Update
It seems to go away from the moment I remove the handling of that msg (removing subscriptions does nothing), the debug log is not the problem. Something to do with the type of that Animation msg I suppose

Does that help?
I can confirm this and spent some time reducing the lines of code. If you install the attached and run with npm run dev then it compiles but uncomment the lines abut Animation in Login.Types/Update and you get the error message
I have this issue as well, but not able to isolate the cause right now.
> elm make src/Main.elm
Success! Compiled 10 modules.
elm: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
error, called at ./Data/Map/Internal.hs:610:17 in containers-0.5.11.0-K2TDqgYtGUcKxAY1UqVZ3R:Data.Map.Internal
If anyone here got an SSCCE, please open a new issue with your SSCCE.
Most helpful comment
This is happening for me as well. I don't have time to make an sscce right now (will post back when I can), but the information that I can add: it's happening with elm 0.19 on macOS 10.12.6 and deleting elm-stuff does not help.
Also why is this closed? Can we keep it open until the problem is fixed?