Skip to content
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 reload pragma for Vite #63

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Fix reload pragma for Vite #63

merged 1 commit into from
Apr 22, 2024

Conversation

lxsmnsyc
Copy link
Member

@lxsmnsyc lxsmnsyc commented Mar 23, 2024

Fixes #22 (the comment, not the thread, since the thread is long fixed).

At some point between Vite 3 and Vite 5, Vite changed their way of checking whether a module should receive the HMR context or not. Previously, they required having the import.meta.hot.accept() call to notify the import analysis that module is going to self-accept.

Currently, they only check for the import.meta.hot expression, but that broke the HMR for Vite such that it's merging import.meta.hot.accept calls, leading to conflicts like declining HMR updates.

The fix here is to remove the unnecessary import.meta.hot.accept call.

@lxsmnsyc lxsmnsyc changed the title fix #22 Fix reload pragma for Vite Mar 23, 2024
@ryansolid ryansolid merged commit ad30cba into main Apr 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pragma is not detected if it's not the first comment in file
2 participants