-
Notifications
You must be signed in to change notification settings - Fork 213
fix: make HMR working again with latest vite version #999
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
base: main
Are you sure you want to change the base?
fix: make HMR working again with latest vite version #999
Conversation
🦋 Changeset detectedLatest commit: b93dcd1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is an automated message. Please do not reply to this comment. |
Svelte content scripts E2E tests fails but looking into it ;-) It take more-than-expected to render broken image and results differs. Other than that everything works as expected (even for vite 3.x). |
In d6fc56c the image is removed from Svelte tests (as well as the check for the image). It changes the test, but makes it more stable. |
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.
Thanks for this PR! This looks like a solid fix for HMR compatibility with newer Vite versions. The issue was that Vite now requires a WebSocket token to be passed for security, which this implementation properly handles.
* replace google.com with example.com * remove broken image from svelte content-script tests to make tests more stable Changes pulled from crxjs#999
Fixing HMR with latest version of the Vite (>=6.0.9, >=5.4.12, <6.0.0, >=4.5.6, <5.0.0) - passing web socket token. Changes based on comment from vite dev (crxjs#971 (comment)) - passing config.webSocketToken to hmr-client-worker.ts under the key __HMR_TOKEN__.
b93dcd1
to
a336cdf
Compare
Rebased over the latest |
Fixing HMR with latest version of the Vite (
>=6.0.9
,>=5.4.12, <6.0.0
,>=4.5.6, <5.0.0
) - passing web socket token.Changes based on comment from vite dev (#971 (comment)) - passing
config.webSocketToken
tohmr-client-worker.ts
under the key__HMR_TOKEN__
.Closes #971