ember-elm icon indicating copy to clipboard operation
ember-elm copied to clipboard

Passing all Elm files into compiler breaks in Elm 0.19.1

Open omarestrella opened this issue 5 years ago • 1 comments

With the introduction of 0.19.1, things seem to have gotten a bit more strict in general in the effort to make errors easier to understand to end users. Because of this, passing all Elm files to the compiler will result in an error during compile when your build contains any helper type modules (i.e. modules that dont export main since they dont expose a UI):

-- NO MAIN ---------------------------------------------------------------------

When producing a JS file, I require that given files all have `main` values.
That way functions like Elm.CSS.ChatConversationStyle.init() are definitely
defined in the resulting file. I am missing `main` values in:

... cut for brevity ...

This seems to come about when you use the --output=<filename>.js flag for elm make, which node-elm-compiler does to feed the file back to consumers.

I believe the issue can be remedied by having addon users supply specific files to compile. Or somehow be able to infer which files are used and then sending just those files to the compiler. The Elm compiler will take care of bringing in any module dependencies.

omarestrella avatar Nov 04 '19 21:11 omarestrella

@omarestrella @MattCheely I created a pull request to address this issue. Please take a look when you get a chance. Your feedback would be appreciated.

https://github.com/nucleartide/ember-elm/pull/45

jalandis avatar Nov 18 '19 01:11 jalandis