nuxi generate on Windows outpus error " ERROR Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'"
See original GitHub issueEnvironment
- Operating System:
Windows_NT
- Node Version:
v17.9.0
- Nuxt Version:
3.0.0-27491748.3186841
- Package Manager:
pnpm@6.32.6
- Builder:
vite
- User Config:
target
- Runtime Modules:
-
- Build Modules:
-
Reproduction
package.json
"scripts": {
"generate": "nuxi generate",
},
nuxt.config.ts
export default defineNuxtConfig({
target: 'static',
})
When do command pnpm generate
in terminal, outputs are:
> @ generate C:\Users\kamas\Apps\nuxt3-electron
> nuxi generate
Nuxt CLI v3.0.0-27491748.3186841 19:43:47
i Vite client warmed up in 1273ms 19:43:52
i Client built in 1635ms 19:43:53
i Building server... 19:43:53
√ Server built in 510ms 19:43:53
√ Generated public .output/public nitro 19:43:53
start Preparing prerenderer... nitro 19:43:53
ERROR Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
at new NodeError (node:internal/errors:372:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1075:11)
at defaultResolve (node:internal/modules/esm/resolve:1155:3)
at ESMLoader.resolve (node:internal/modules/esm/loader:604:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
at ESMLoader.import (node:internal/modules/esm/loader:404:22)
at importModuleDynamically (node:internal/modules/esm/translators:106:35)
at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
at prerender (/C:/Users/kamas/Apps/nuxt3-electron/node_modules/.pnpm/nitropack@0.2.1/node_modules/nitropack/dist/chunks/prerender.mjs:2142:39)
at async /C:/Users/kamas/Apps/nuxt3-electron/node_modules/.pnpm/nuxt3@3.0.0-27491748.3186841/node_modules/nuxt3/dist/index.mjs:1221:9
ELIFECYCLE Command failed with exit code 1.
Many thanks for any help.
Describe the bug
This bug occurs with even the very latest version of nuxt3 (3.0.0-27491748.3186841).
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:25 (5 by maintainers)
Top Results From Across the Web
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file ...
Notice the error message: Only file and data URLs are supported by the default ... On Windows, absolute paths must be valid file://...
Read more >The generate Property - Nuxt
The generate property. Configure the generation of your universal web application to a static web application. Type: Object. When calling nuxt.generate() ...
Read more >Module | webpack - JS.ORG
When used, webpack would generate relative URLs for new URL() syntax, i.e., ... The issuer: An absolute path to the file of the...
Read more >RequireJS API
If there is no explicit config and data-main is not used, then the default baseUrl is the directory that contains the HTML page...
Read more >next.config.js: Introduction
js module, not a JSON file. It gets used by the Next.js server and build phases, and it's not included in the browser...
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
I get the same error with @nuxtjs/robots on
nuxt dev
only.nuxt generate
works fine当我使用
pnpm add @nuxtjs/robots
之后也会出现一样的问题,remove
之后工作正常