vite-pwa / remix

Zero-config PWA Plugin for Remix
https://vite-pwa-org.netlify.app/frameworks/remix
MIT License
58 stars 2 forks source link

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 closed 1 month ago

arnaudambro commented 1 month ago

The code for repro is in this PR: https://github.com/vite-pwa/remix/pull/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 commented 1 month ago

I actually also opened an issue there -> https://github.com/vite-pwa/vite-plugin-pwa/issues/755

userquin commented 1 month ago

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

Read the contributing guide.

userquin commented 1 month ago

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

arnaudambro commented 1 month ago

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