-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Elm + parcel serve unusable: File changes not detected after compilation error #6124
Comments
This sounds somewhat similar to what is being described here (#5660 (comment)) and was potentially fixed here (#6072), but it doesn't look like the latter has fixed the issue. The primary difference is that the watcher breaks only after compilation error. |
I'm seeing this same behavior. Details:
|
Does this still happen with the latest nightly? |
@mischnic Yup; just tried it with |
I am experiencing the same problem. If compilation fails due to errors in scss files then recompilation is working only in case of editing entrypoint file (index.html in my case) |
Just migrated to parcel 2. I am seeing the same with |
I've noticed this problem, too, when I split my small Elm project into several source files: after any compilation error, changes to files included from the main Elm file are not detected (I'm at I've looked into the source code of the Elm transformer: the invalidations related to the source files included from the main Elm file are added to the main Asset object (by Looking more through the core part of Parcel, I can't find a clean way to pass information about a failed transformation that would preserve the invalidations. That might be a reason for similar reports in some of the other transformation plugins / file formats (#5965) and why #6072 didn't solve this problem. |
…e reference) Bug reference: parcel-bundler/parcel#6124
Same here with every parcel 2.0 version, with Elm on Mac M1 OS 11.2.1 |
Workaround for vim: |
I don't get this bug with rc. |
@domenkozar are you sure ? on linux or osx when elm build failed, had to reload the build to recover. |
It works for me on linux, same verisons. |
Ah sorry, it works for Main.elm but not other files. |
@mischnic have you read #6124 (comment) - it might give a clue why plugin caching isn't working |
There was a similar bug in v1: #2475 |
Just to add my voice here, tested 2.0.0-nightly.843 today and the bug still exists. |
Similar to what @myrho suggested for Vim users, here's a more generic node-based workaround using chokidar-cli and concurrently: {
"scripts": {
"start:watch": "chokidar 'src/**/!(Main).elm' -c 'touch src/Main.elm'",
"start": "concurrently -n \"watch,parcel\" -c \"blue,green\" -k \"npm run start:watch\" \"parcel serve index.html\""
}
} |
I don't have time to fix this, but I'm willing to chip into whoever picks it up! Doesn't have to be mergable, just that it works and improves my feedback loop. It's most likely very similar to #2475 but for v2. |
@devongovett this issue got inadvertently closed. |
I'm getting this with parcel 2.0.1 too; no reload when modifying This happens even before any compiler error from elm. |
I tried upgrading one of my Elm projects to parcel v2. I'm seeing the same issue: No recompilation after a breaking edit in any other elm file than Everything else worked well. Would be so good to have this fixed. It's the only thing stopping Elm users from migrating to Parcel v2. |
@n1k0 Thanks this chokidar and concurrently workaround works nicely for now. |
I have the same issue. And the suggestion over by touching the Main.elm file did break hot-reloading for me.
|
Hot module reloading would freeze as soon as it encountered any compilation error. So when introducing a compilation error (e.g., a missing semicolon for a CSS rule) and then saving, the HMR is just frozen. Even if you fix the compilation error by adding the semicolon, it remains frozen, meaning that I often think that my CSS is wrong, even when it's not. What this line of code does is just does a refresh of the page whenever a change is encountered. Nothing fancy, and it means that it works predictably. Similar issue but related to Elm instead of CSS: parcel-bundler/parcel#6124
🐛 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 makesparcel serve/watch
basically unusable w/ Elm.SSCCE here
🎛 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
Thanks,
Coury
The text was updated successfully, but these errors were encountered: