-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
"HMR dead end" false positive due to /@id/ prefix #2380
Labels
Comments
Here's the repro with instructions |
aleclarson
added a commit
to aleclarson/vite-plugin-react-pages
that referenced
this issue
Mar 11, 2021
This avoids the issue described in: vitejs/vite#2380
aleclarson
added a commit
to aleclarson/vite-plugin-react-pages
that referenced
this issue
Mar 11, 2021
This avoids the issue described in: vitejs/vite#2380
By taking the same approach as
|
aleclarson
added a commit
to aleclarson/vite-plugin-react-pages
that referenced
this issue
Mar 11, 2021
This avoids the issue described in: vitejs/vite#2380
One problem with the work around is TypeScript won't let you
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Note: This seems to affect virtual modules only.
vite/packages/vite/src/node/plugins/importAnalysis.ts
Lines 201 to 204 in 4364992
In the snippet above,
/@id/
is prefixed to bare imports. This "normalized URL" is added to the module'simportedUrls
set (here), which is then passed tomoduleGraph.updateModuleInfo
(here). Then a module is created for the/@id/
-prefixed bare import (here).But then in
transformRequest
, the same bare import is not prefixed with/@id/
, which leads to a duplicate module being created (here). This duplicate module won't know which modules it's imported by, which leads to "HMR dead end" false positives (here).System Info
vite
version: 2.0.5The text was updated successfully, but these errors were encountered: