-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(vite): fix Fast Refresh load error when using defer #7842
Conversation
Signed-off-by: Marc MacLeod <[email protected]>
🦋 Changeset detectedLatest commit: 8129f3d The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Hi @marbemac, Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected]. Thanks! - The Remix team |
Signed-off-by: Marc MacLeod <[email protected]>
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Thanks for the PR! I just updated your branch, merging the latest from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is failing in Firefox, seeing if I can fix it.
@markdalgleish hmm - I can't reproduce the firefox issue locally - is it still occurring for you? |
I could only reproduce it locally when running the test in Firefox via Playwright. I found a workaround that seemed to do the trick though, so CI is passing now. |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
jcs} here is my vite.config.ts /// export default defineConfig({ ], }); |
To replicate the problem:
Why?
While the recommendation to put
<LiveReload />
before<Scripts />
mitigates the problem in the non-deferred stream use-case, deferring the stream means that non-async modules on the page might be parsed after async modules (since async modules can be run before page parsing is even complete).This PR updates the refresh runtime fragment to also be marked as async, which resolves the issue from what I can tell in my local testing.
Probably not the final solution here, as I know ya'll are trying to find a way to avoid having to re-order LiveReload/Scripts in general. But this should at least unblock anybody with an app that uses deferred streaming who is looking to try the vite plugin in the meantime.