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

Internal server error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'virtual:' #14

Closed
arnaudambro opened this issue Sep 17, 2024 · 4 comments

Comments

@arnaudambro
Copy link

The code for repro is in this PR: #13

when running npm i && npm run dev within examples/pwa-simple-pw I get this error

[vite] Internal server error: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. Received protocol 'virtual:'
      at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11)
      at defaultLoad (node:internal/modules/esm/load:130:3)
      at ModuleLoader.load (node:internal/modules/esm/loader:409:13)
      at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:56)
      at new ModuleJob (node:internal/modules/esm/module_job:65:26)
      at #createModuleJob (node:internal/modules/esm/loader:303:17)
      at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:260:34)
      at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:17)
      at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:21) (x3)
@arnaudambro
Copy link
Author

I actually also opened an issue there -> vite-pwa/vite-plugin-pwa#755

@userquin
Copy link
Member

userquin commented Sep 17, 2024

Why are you installing dependencies with npm? This is a pnpm monorepo, all pwa depedencies using workspace: protocol.

Read the contributing guide.

@userquin
Copy link
Member

Your error is about missing PWA dependencies, there is no Vite plugin resolving the corresponding virtual module.

@arnaudambro
Copy link
Author

It doesn't yell anymore but I'm not sure why

maybe because I installed vite-plugin-pwa ? is it a requirement ?

anyway, closing because I think you were right about dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants