-
-
Notifications
You must be signed in to change notification settings - Fork 190
Open
Description
Describe the bug
In Nuxt 3, custom queries are added to id when importing files under pages directory, such as
/pages/index.vue?vue&type=script&lang.jsx¯o=true (in this case, macro=true)
In this case, vue jsx plugin does not acknowledge the context and throws an error.
More info: nuxt/nuxt#13435
Probably related to PR vitejs/vite#7121
Reproduction
https://stackblitz.com/edit/vitejs-vite-uo2vwz
System Info
System:
OS: Linux 5.16 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (16) x64 AMD EPYC 7B13
Memory: 33.38 GB / 62.80 GB
Container: Yes
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
Yarn: 3.2.1 - ~/.nvm/versions/node/v16.15.0/bin/yarn
npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npmUsed Package Manager
yarn
Logs
ERROR 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.
WARN [SSR] Error transforming /pagess/index.vue?vue&type=script&setup=true&lang.jsx¯o=true: 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.
at formatError (node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38663:46)
at TransformContext.error (node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38659:19)
at TransformContext.transform (node_modules/vite/dist/node/chunks/dep-59dc6e00.js:56777:22)
at async Object.transform (node_modules/vite/dist/node/chunks/dep-59dc6e00.js:38900:30)
at async doTransform (node_modules/vite/dist/node/chunks/dep-59dc6e00.js:55857:29)Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels