madsflensted / elm-brunch

Brunch plugin to compile Elm code
MIT License
74 stars 31 forks source link

Unexpected end of input #4

Closed Dkendal closed 8 years ago

Dkendal commented 8 years ago

Using version 0.3.1, brunch can't compile any elm files:

iex(1)> Elm compile: Main.elm, in web/elm, to ../static/vendor/main.js 27 Sep 17:34:26 - error: Compiling of 'web/static/vendor/main.js' failed. Line 777: Unexpected end of input

After downgrading to 0.3.0, the problem goes away. This is with elm 2.0.0, Linux 3.16.0-37.

main.elm:

module Main where

import Html exposing(..)

main = text "sup"

Elm has no issue compiling it with elm-make.

madsflensted commented 8 years ago

@Dkendal Could not reproduce this error, and it is a bit strange since 0.3.1 is purely a documentation update.

One thing that comes to mind reading the error message is that it looks like brunch is trying to read main.js before elm has finished writing it.

Can you post your brunch-config.js?

Dkendal commented 8 years ago

Upon revisiting this last night, I think vim was the real culprit. Vim saves files twice, once in a weird state, which would not be valid for compilation.

Dkendal commented 8 years ago

i.e. when using brunch build post save everything is fine. This issue is likely fine to close.

madsflensted commented 8 years ago

thanks for the feedback.