Kevin Yank
2017-04-13 11:27:25 UTC
For awhile now, weâve been seeing intermittent issues with our build, where
a particular module in our application will occasionally be missing from
the JavaScript output produced by the Elm compiler. Weâve seen it happening
both in our CI environment and when building assets for production. We have
yet to see it happen on a development machine. As our codebase has grown,
this issue seems to be occurring more and more often, so I thought it might
be worth checking if anyone else in the community had experienced anything
like it.
As I said, the problem manifests itself by a build producing a JavaScript
output file where a particular module is simply missing. We then see an
error like this one at runtime:
ReferenceError: Can't find variable: _user$project$Dialog$init
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568:83
ReferenceError: Can't find variable: _user$project$Dialog$init
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568:83
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:66078
ReferenceError: Can't find variable: _user$project$Dialog$init
ReferenceError: Can't find variable: _user$project$Dialog$init
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:160309 in
A2
âŠ
When we repeat the build, we get a JavaScript bundle that works just fine.
Comparing the contents reveals a chunk of JavaScript corresponding to one
of our modules is simply missing. Where the Elm compiler seems to normally
generate a single line of whitespace between two modulesâ JavaScript
output, there is a conspicuous two-line gap at the point where the missing
code should be. Hereâs what this looks like in a diff tool:
Obviously this is a very long way from anything like a minimal test case
that we could submit as a compiler bug, and unfortunately we canât
reproduce it reliably enough to be able to narrow it down.
What Iâm hoping is that someone else in the community is seeing something
like this too. Actually, if Iâm being honest, Iâm hoping one of our friends
at NoRedInk has experienced this issue and one of them is going to pop in
and tell me âOh yeah, thatâs been fixed for the eventual release of 0.19.â
Of possible relevance: weâre building our JavaScript bundles using Webpack
and the elm-webpack-loader
<https://www.npmjs.com/package/elm-webpack-loader>. We have it configured
to run only a single instance of the Elm compiler at once, though, so Iâm
not sure how it could be responsible for this issue.
Fingers crossed weâre not alone in this!
--
Kevin Yank
Lead Developer
twitter: @sentience
skype: kevinyank
Culture analytics for your company
www.cultureamp.com
a particular module in our application will occasionally be missing from
the JavaScript output produced by the Elm compiler. Weâve seen it happening
both in our CI environment and when building assets for production. We have
yet to see it happen on a development machine. As our codebase has grown,
this issue seems to be occurring more and more often, so I thought it might
be worth checking if anyone else in the community had experienced anything
like it.
As I said, the problem manifests itself by a build producing a JavaScript
output file where a particular module is simply missing. We then see an
error like this one at runtime:
ReferenceError: Can't find variable: _user$project$Dialog$init
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568:83
ReferenceError: Can't find variable: _user$project$Dialog$init
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568:83
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:66078
ReferenceError: Can't find variable: _user$project$Dialog$init
ReferenceError: Can't find variable: _user$project$Dialog$init
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:172568
at
http://localhost:3001/assets/exit-34cc2ad64db7cb8f54fd.bundle.js:160309 in
A2
âŠ
When we repeat the build, we get a JavaScript bundle that works just fine.
Comparing the contents reveals a chunk of JavaScript corresponding to one
of our modules is simply missing. Where the Elm compiler seems to normally
generate a single line of whitespace between two modulesâ JavaScript
output, there is a conspicuous two-line gap at the point where the missing
code should be. Hereâs what this looks like in a diff tool:
Obviously this is a very long way from anything like a minimal test case
that we could submit as a compiler bug, and unfortunately we canât
reproduce it reliably enough to be able to narrow it down.
What Iâm hoping is that someone else in the community is seeing something
like this too. Actually, if Iâm being honest, Iâm hoping one of our friends
at NoRedInk has experienced this issue and one of them is going to pop in
and tell me âOh yeah, thatâs been fixed for the eventual release of 0.19.â
Of possible relevance: weâre building our JavaScript bundles using Webpack
and the elm-webpack-loader
<https://www.npmjs.com/package/elm-webpack-loader>. We have it configured
to run only a single instance of the Elm compiler at once, though, so Iâm
not sure how it could be responsible for this issue.
Fingers crossed weâre not alone in this!
--
Kevin Yank
Lead Developer
twitter: @sentience
skype: kevinyank
Culture analytics for your company
www.cultureamp.com
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.