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
- Initialize a folder with the hello world sample from the parcel website: https://parceljs.org/elm.html.
- Run
parcel index.html
- Change
Hello, Elm!
in Main.elm to something else - Go to http://localhost:1234
- You should see changes in the browser
- Repeat step 3
- 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)
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 addlet 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.