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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot reload refreshes before updating (shows pervious version) #8940
Comments
Duplicate of #8827 ? |
@fredcallaway Please share some example code that can be used to reproduce this. |
Yes this is the same as #8827 I doubt this is useful, but I see the problem working from this repository: https://github.com/fredcallaway/graph-nav. I unfortunately don't have time to produce a minimal example :\ |
A specific commit and instructions on how to trigger this behaviour would also work |
I'm afraid it's a bit involved, but here it is: fredcallaway/graph-nav@f4b17ac Steps to reproduceInstall Python dependencies into a virtualenv:
Install parcel and eslint:
If you have forego, then you can just do
Now you can edit any file to see the behavior. The easiest test is to open static/graph-nav/js/jspsych-CircleGraphNavigationInstruction.js and edit the "Welcome!" message on line 43. I won't be offended if you don't do all that, but I'd be glad if it was useful :) If you have any specific ideas about what could be wrong, I'm happy to do some testing myself as well. |
Hello @fredcallaway, I am having a similar issue, but I'm working with proprietary code which I cannot share for reproduction purposes. Can I ask a couple of questions to confirm your situation?
This resembles similarities to the application I am working on, where the web server is serving the assets (JavaScript, etc) and I'm using the What happens in my situation is:
I have noticed, that if Parcel finishes building quick enough (<100ms) often these will be written to the Note, I have disabled the browser cache (through DevTools) and my web server returns unique URLs for the 'static' files, which includes a hash of the file content, this has helped a lot to reduce the impact of this problem. I've tracked through the Parcel code and I think I've found the code that triggers the refresh, and possibly why it is happening too early. I don't have time today to dig into this and try to test making changes, I will try to do that tomorrow. During the "buildProgress" event type in ServerReporter.js, a call is made to I expect that if this call is moved into the "buildSuccess" event type handler, it will trigger at the right time after files are written to disk. I anticipate this wouldn't be a problem if I was using the |
@yoshifp yup sounds like you're experiencing the same thing as me.
Yup!
Also yup! The server is gunicorn (wrapped by psiturk). |
This is caused by #8582 Which sends HMR updates to the browser client's websocket before the bundles are written to disk. Because in the common case for e.g. React apps (using And this is why using something other than the builtin dev server breaks here: it doesn't wait until the build is finished to server to fresh bundles. |
I have a pretty unconventional setup where I process |
馃悰 bug report
Hot reload triggers a browser refresh (or something resembling it), but it reflect the state of the code before the save event. I need to save the file twice to see the correct version.
馃帥 Configuration (.babelrc, package.json, cli command)
No babel configuration.
Command:
The text was updated successfully, but these errors were encountered: