-
-
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
Watching and rebuild files stops working after once or twice #5660
Comments
I have also similar problems where HMR randomly stops working |
Does this still occur with Parcel 2? We created a new file watcher which is a lot more performant and reliable than chokidar. |
Yes I only use Parcel 2 and (beta 1 because nightlies compile with a strange error with 0 google results) Maybe it stops working when I put my computer to sleep and resume.. not sure, but it happens daily that it stops refreshing when files change (js/css or whatever) |
@yairEO I've never experienced this so a way to reproduce this would be very useful |
Hello 👋 I was about to log this same bug when I did a search and found this thread. I am in the process of upgrading a project from Parcel v1 to v2 and hit this bug. I chatted it through with a friend and he tried upgrading a v1 project to v2 and also reproduced it straight away. Since it seemed to be quite an obvious bug, I assumed it was a temporary issue and didn’t report it, but I tried again today and the problem remains. I have also now found this thread and realised the conditions for reproducing it might be a little more obscure than I first assumed. The potentially good news is that the project where this is happening is an open-source project, so it's possible it could become the reproducible case you were looking for @DeMoorJasper. If you'd like to try and reproduce it, I can consistently reproduce it on the parcel-v2 branch of this project. The key thing is that the file watching seems to be 100% reliable when the “main” source file is saved. It’s changes to the files that are linked from the “main” files that are problematic. Steps to reproduce are as follows:
It may take a few successful saves of the a “child” file until it stops triggering the re-build, but it’s pretty consistently after one successful re-build on my machine. I’m running Big Sur 11.2.3 (20D91). This also happens when opening |
@daveverwer That sounds a bit like the situation that #6072 fixed. Can you try the latest nightly ( Also, what do you mean by "save"? Do you change the file contents or really just re-save without modifying? |
Just tried this and it does seem to resolve it! Thank you! |
I have this same issue with |
I'm also having the same issue on Let me know what I can provide to help fix this. In the mean time, if there is a way to have the same functionality as v1 (just refreshing the page) on save? Having to manually refresh it is a huge pain. |
Another interesting thing I noticed is that when I put an error in my JS and save the overlay showing the error shows in the browser after saving. It seems like parcel is aware of my files changes but they just aren't getting applied to the DOM |
Watching is now working for me now with |
This is still broken for me on parcel@next (beta 3 and v2.rc0) |
This is still broken for me on v2.0.0. I have just upgraded from v1 and noticed the issue. |
installing |
Still broken on parcel@next (v2.0.0-rc.0) |
the error warning still occur
|
I'm also having the same issue. HMR isn't working.
Update Just added
|
Any Update on this thread? |
I'm experiencing this problem on Arch Linux with everything updated to the latest via I have another machine running Pop_OS 21.04 (Ubuntu) and it seems to work fine. EDIT: it appears that the cache-busting filename hash is not changing so my browser is using an old cached version. If I look at Parcel's output in ok never mind. My issue seems to be a case of #1305 |
The connection to the HMR server was lost after I unlocked the computer. And the changes will never show on the page. To prevent this, I used hot module replacement in my javascript file. Simply add the below line of code into a javascript file.
It's worked for me. I hope this will help |
I ran into this problem today. All day long I can't figure out what the problem is. Yesterday parcel worked fine with this configuration:
Today HRM doesn't work after 2-3 changes. The first change updates the page normally. The next ones indicate that: Error: ENOENT: no such file or directory, unlink 'D:\Development\decor\app\public\wp-content\themes\bricks-child\dist\front\js\main.js.3020.8' I tried different version 2.9.0, nightly, but it doesn't help. I also completely reinstalled packages Need any help |
I also suddenly experienced this recently, and realized it was because I upgraded from It worked again after I reverted. |
I'm not getting any hot module reloading or page reloads when updating React components. Running Parcel v2.9.3 with React 18 on macOS 13.5.1. If I save the When I save a I tried downgrading to Parcel 2.8.2 and that didn't fix the problem. |
We have a situation that looks like the issue here. In a legacy code base we have an intermediate step; whenever we change something in source files we need to run a script that does some preprocessing on the files and writes half baked files to a HTML changes are picked up correctly, but when a |
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
When I use the
watch
command, I expect that the building process updates itself automatically when I modify a file.😯 Current Behavior
This mechanism is working, but only once for each file. The first time I modify a file after having launched the
watch
command, it is taken into account in the rebuild, but then the next modification does not have any effect. If I modify an other file it's working but only once. There is no message displayed when it's not working.I'm on Linux (Ubuntu 20.04) and I use gedit as code editor. If I use vim, I have the same behavior. But if I edit the file on the command line using
echo
, each modification is taken into account by the rebuild process :💁 Possible Solution
This is due to this issue : when gedit is writing modifications to a file, it copies the new content to a new file and then delete the old one. So the link between the file and the watcher is lost after the first edition.
I was able to fix it by modifying the
watch
function inBundler.js
:🔦 Context
💻 Code Sample
This bug can be reproduced with the demo example and the default configuration
🌍 Your Environment
The text was updated successfully, but these errors were encountered: