madsflensted / elm-brunch

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

elm-brunch watch --server gets out of sync #39

Closed anagrius closed 2 years ago

anagrius commented 6 years ago

Problem

Since 0.10.0 elm-brunch somehow gets out of sync with the files on disk. This results in elm-brunch --watch reporting compile errors even after the issues have been resolved.

I don't have a small isolated example. But I will try explaining the symptoms:

While working on the project and changing some things, I introduce a compile error. Most of the time, the elm-brunch is happy after having corrected the compile error. But quite often maybe like 1 of 20 times, elm-brunch gets stuck on a compile issue and will continue to report it even after the issue has been resolved.

Workaround: Restart brunch, everything compiles.

Possible causes:

  1. Our project is one of the worlds larges ~60kloc Elm code bases and the issue may be some race condition that only happens when there are many files.
  2. We are using atom-elm-make which will compile the code on save and show compile errors in the IDE. This could be conflicting with the elm-make instance that elm-brunch is executing. I know there have been recent issues in the atom-elm-make github issues where multiple elm-make instances would run simultaneously. That has since been resolved.
  3. Brunch is somehow caching old files or not noticing the changes to the files to update the cache.

Please let me know how I can provide more information. This does not occur with webpack. I will try elm-brunch 0.7.0 and report back with my findings.

Information

razzeee commented 6 years ago

Any leads on this?

gak commented 6 years ago

I also have this problem (macOS, different IDE).

sashaafm commented 6 years ago

I think I might have this problem too

jdewar commented 5 years ago

I have seen it in Atom and VSC -- this doesn't seem to be an editor artifact. i save the file, and i see the last error -- yet the file i saved actually has no errors.

it looks as if i did nothing, and yet it is now working -- this bug is very hard to adjust for by habit only.

razzeee commented 5 years ago

If you're using Phoenix, they switched from brunch to webpack which works flawless for me so far.

On Mon, 13 Aug 2018, 02:39 jdewar, notifications@github.com wrote:

I have seen it in Atom and VSC -- this doesn't seem to be an editor artifact. i save the file, and i see the last error -- yet the file i saved actually has no errors.

it looks as if i did nothing, and yet it is now working -- this bug is very hard to adjust for by habit only.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/madsflensted/elm-brunch/issues/39#issuecomment-412383102, or mute the thread https://github.com/notifications/unsubscribe-auth/AFqyZPZDK4ex2zjDBXrEBDxH5FHdJHDfks5uQMq8gaJpZM4QQvMS .