[V3] Failed to parse source for import analysis when dynamic import has comment #8918
Closed
7 tasks done
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
OK ->
Wrong ->
Reproduction
https://stackblitz.com/edit/vitejs-vite-33fr4f?file=src%2FApp.tsx&terminal=dev
System Info
Used Package Manager
npm
Logs
[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
/home/projects/vitejs-vite-33fr4f/src/App.tsx:83:3
81 | }, 30);
82 | }
83 | }
| ^
84 |
at formatError (file:///home/projects/vitejs-vite-33fr4f/node_modules/vite/dist/node/chunks/dep-c7f6d0a5.js:35002:46)
at TransformContext.error (file:///home/projects/vitejs-vite-33fr4f/node_modules/vite/dist/node/chunks/dep-c7f6d0a5.js:34998:19)
at TransformContext.transform (file:///home/projects/vitejs-vite-33fr4f/node_modules/vite/dist/node/chunks/dep-c7f6d0a5.js:39908:22)
at async Object.transform (file:///home/projects/vitejs-vite-33fr4f/node_modules/vite/dist/node/chunks/dep-c7f6d0a5.js:35247:30)
at async loadAndTransform (file:///home/projects/vitejs-vite-33fr4f/node_modules/vite/dist/node/chunks/dep-c7f6d0a5.js:37701:29
Click outside or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.js.
Validations
The text was updated successfully, but these errors were encountered: