parcel: Elm + parcel serve unusable: File changes not detected after compilation error
π bug report
If Elm compilation fails then parcel serve/watch
auto-recomplitaion mostly breaks. If the entry-point Elm file (i.e. Main.elm) is edited then recompilation will work, but if any non-entry-point Elm file is edited recompilation does not occur. Since the entry point (Main.elm
) is very rarely touched in most Elm projects it makes parcel serve/watch
basically unusable w/ Elm.
π Configuration (.babelrc, package.json, cli command)
https://github.com/cmditch/parcel2-elm-error/blob/master/package.json
π€ Expected Behavior
Every time an Elm file is touched, regardless of the compilation state, parcel serve/watch
should recompile the project.
π Possible Solution
No idea. The watcher seems to work on all Elm files, but only when the last compilation was a success.
π» Code Sample
Clone and run yarn; yarn hot
in the SSCCE here and see instructions here to reproduce.
π Your Environment
Software | Version(s) |
---|---|
Parcel | 2.0.0-nightly.639+059d502f |
Node | 12.22.0 |
npm/Yarn | yarn 1.22.10 |
Operating System | macOS 10.15.7 |
Thanks, Coury
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 23 (3 by maintainers)
I have the same issue. And the suggestion over by touching the Main.elm file did break hot-reloading for me. I found that touching index.js whenever any elm file changes will preserve the hot reloading functionallity π in package.json
Similar to what @myrho suggested for Vim users, hereβs a more generic node-based workaround using chokidar-cli and concurrently:
Workaround for vim:
autocmd BufWritePost *.elm :silent exec "!touch src/index.html"
@n1k0 Thanks this chokidar and concurrently workaround works nicely for now.