parcel: Elm files do not hot reload on Ubuntu

🐛 bug report

On Ubuntu, Elm files do not compile and hot reload after a change is made. This only affects changes after the very first change.

🤔 Expected Behavior

Parcel should compile Elm files after a change is made to it

😯 Current Behavior

Changes after the first change (first from starting parcel serve) to an Elm file do not trigger a compile. Interestingly this issue does not occur on my Macbook Air Sierra with the exact same parcel/npm/node versions.

💁 Possible Solution

'

Something wrong with chokidar on Ubuntu?

🔦 Context

Just trying to run hello world in Elm

💻 Code Sample

  1. Initialize a folder with the hello world sample from the parcel website: https://parceljs.org/elm.html.
  2. Run parcel index.html
  3. Change Hello, Elm! in Main.elm to something else
  4. Go to http://localhost:1234
  5. You should see changes in the browser
  6. Repeat step 3
  7. No changes are seen anymore

🌍 Your Environment

Software Version(s)
Parcel 1.11.0
Node v10.9.0
npm/Yarn 6.7.0
Operating System Ubuntu 16.04.5 LTS

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 20 (5 by maintainers)

Most upvoted comments

However, there must be a way around this as I have never had these issues with webpack or other file watchers before. Would be cool if that could be implemented in parcel, since right now my only option is to turn off auto formatting which is very useful.

Just FYI, I figured out why the safe-write workaround does not work. The elm-vim extension has autoformat on, which apparently renames file during reformatting. To disable this behaviour add let g:elm_format_autosave=0

to your .vim file.

The issue is definitely related to renaming the file on write, as evidenced by inotify events.