Failed to parse source for import analysis because the content contains invalid JS syntax
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
npm@8.5.5
- Builder:
vite
- User Config:
nitro
,typescript
- Runtime Modules:
-
- Build Modules:
-
Reproduction
build the project with npm run build
Describe the bug
When running npm run build
i see the following message. I don’t know which file the error is referring to
Additional context
No response
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.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Failed to parse source for import analysis because the content ...
Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name...
Read more >javascript - plugin:vite:import-analysis - Failed to parse source ...
Failed to parse source for import analysis because the content contains invalid JS syntax. There's nothing wrong in i18n.js file as it was ......
Read more >vite failed to parse source for import analysis ... - You.com
Hi, got this error Failed to parse source for import analysis because the content contains invalid JS syntax. You may need to install...
Read more >[plugin:vite:import-analysis] Failed to parse source for ... - Reddit
[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax.
Read more >Unable to return HTML in Vue component - Laracasts
[plugin:vite:import-analysis] Failed to parse source for import analysis because the content contains invalid JS syntax. Install @vitejs/plugin-vue to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
on my end this error occurs, if single quotes are used in the src of a font-face declaration:
if this is changed to double quotes, the error vanishes:
This is coming from Vite (though perhaps because of a transform that Nuxt is doing). I agree that there should be a better error message that indicates (at least) which source file the issue is coming from. It would be worth raising that as an issue at https://github.com/vitejs/vite.