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

incompatible with paths with ' in the filename #12909

Closed
jaguarsiva opened this issue Nov 28, 2021 · 5 comments
Closed

incompatible with paths with ' in the filename #12909

jaguarsiva opened this issue Nov 28, 2021 · 5 comments

Comments

@jaguarsiva
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v14.18.1
  • Nuxt Version: 3.0.0-27296423.f3082ca
  • Package Manager: npm@6.14.15
  • Bundler: Vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

I haven't wrote even a single line of code. I just installed nuxt3 using npx nuxi init nuxt3-app, changed directory and installed the dependencies using npm install. Without even touching a single file, I ran npm run dev and it doesn't even show the <NuxtWelcome /> page to me in the browser. The loading page keeps on spinning.

Describe the bug

The loading page keeps on spinning in the browser. I could see vite build it successfully and then a error message and a few warnings thrown into the terminal [ attached below ].

Additional context

No response

Logs

[SSR] Error transforming virtual:<Mypath here>/.nuxt/plugins/server.mjs: 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[SSR] Error transforming virtual:<Mypath here>/.nuxt/plugins/server.mjs: 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 virtual:<Mypath here>/.nuxt/root-component.mjs: 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 virtual:<Mypath here>/.nuxt/app-component.mjs: 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.

√ Vite server built in 1133ms                                                   11:58:41  
√ Nitro built in 328 ms                                                         11:58:42  

 ERROR  [worker] Unexpected identifier                                          11:58:42  

  at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
  at async link (internal/modules/esm/module_job.js:67:21)


 WARN  [worker] Unexpected identifier                                           11:58:42  

  at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
  at async link (internal/modules/esm/module_job.js:67:21)/.nuxt/root-component.mjs: 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 virtual:C:/Siva's Web Dev Files/Projects/Portfolio Revamp/nuxt3-app/.nuxt/app-component.mjs: 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.

√ Vite server built in 1133ms                                                   11:58:41  
√ Nitro built in 328 ms                                                         11:58:42  

 ERROR  [worker] Unexpected identifier                                          11:58:42  

  at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
  at async link (internal/modules/esm/module_job.js:67:21)


 WARN  [worker] Unexpected identifier                                           11:58:42  

  at Loader.moduleStrategy (internal/modules/esm/translators.js:145:18)
  at async link (internal/modules/esm/module_job.js:67:21)
@danielroe
Copy link
Member

The issue is the ' in your file path. A workaround would be to move your project elsewhere.

@danielroe danielroe self-assigned this Nov 29, 2021
@danielroe danielroe changed the title Error: Failed to parse source for import analysis because the content contains invalid JS syntax. incompatible with paths with ' in the filename Nov 29, 2021
@pi0
Copy link
Member

pi0 commented Apr 1, 2022

@danielroe Can this be closed or waiting for vitejs/vite#5896?

@danielroe
Copy link
Member

This is still waiting on an upstream fix, though note that I think it might need more fixes than just that PR.

@issue-up
Copy link

issue-up bot commented Jan 19, 2023

@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
@madebyfabian
Copy link
Sponsor Collaborator

Filenames with ' are not common and will cause issues anywhere. Upstream closed. Would suggest to close this.

@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants