nuxt
nuxt copied to clipboard
Only URLs with a scheme in: file, data are supported by the default ESM loade
Environment
- Operating System:
Windows_NT
- Node Version:
v18.12.1
- Nuxt Version:
3.0.0
- Nitro Version:
1.0.0
- Package Manager:
[email protected]
- Builder:
vite
- User Config:
modules
,typescript
,build
,css
,vite
,runtimeConfig
- Runtime Modules:
[email protected]
- Build Modules:
-
Reproduction
Versions
- nuxt: v3.0.0
- node: v18.12.1
- windows: 10
By installing nuxt security and placing the dependency in nuxtjs config - modules: ['nuxt-security'] - https://nuxt.com/modules/security
Describe the bug
[worker reload] [worker init] 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:'
Additional context
It should be noted that I have tried several versions of nuxt and node - I have deleted node_modules - yesterday I upgraded nuxt and today again.
me too...
I want to point out that this is a general nuxt Windows-specific bug , I only have this on my Windows machine, and I have it with any module.
Same with @nuxtjs/robots
module. In development, the import for the alias #robots
is written without the file://
import.
I have the same problem on nuxt3 3.0.0-rc.13
with @nuxtjs/robots 3.0.0
on a Windows machine
@pi0 @danielroe guys, this is quite an important bug, it means that for the last month or so people are not able to run the development environment on Windows. It is really important for the adoption of nuxt 3 that someone takes care of it!
This should be resolved in the edge channel, or in the next release.
If you're still experiencing it, please reply with a reproduction (as this error message can come from different sources) and I'll reopen.
This should be resolved in the edge channel, or in the next release.
If you're still experiencing it, please reply with a reproduction (as this error message can come from different sources) and I'll reopen.
Unfortunately still an issue with:
- Operating System:
Windows_NT
- Node Version:
v16.13.1
- Nuxt Version:
3.0.1-rc.0-27848798.0cb9a4c
- Nitro Version:
2.0.0-27847631.8186a02
- Package Manager:
[email protected]
- Builder:
vite
- User Config:
ssr
,runtimeConfig
,typescript
,css
,intlify
,modules
,alias
,vite
- Runtime Modules:
[email protected]
,@nuxtjs/[email protected]
,@vueuse/[email protected]
,@intlify/[email protected]
- Build Modules:
-
I'll try to provide a sandbox reproduction in the upcoming days @danielroe!
Error log:
ERROR [worker reload] [worker init] Only file and data URLs 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:371:5)
at defaultResolve (node:internal/modules/esm/resolve:1016:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
This is not resolved. I'm using edge channel.
If you're still experiencing it, please reply with a reproduction (as this error message can come from different sources) and I'll reopen.
I found the part that caused the error. Occurred when adding a nuxt-proxy module and using the proxy option.
https://github.com/teamboot88/reproduction
I can confirm Clean Nuxt 3 Add nuxt-proxy with options.
{ "private": true, "scripts": { "build": "nuxt build", "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", "postinstall": "nuxt prepare" }, "devDependencies": { "nuxt": "3.0.0" }, "dependencies": { "nuxt-proxy": "^0.3.7" } }
` ERROR [worker reload] [worker init] 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:'32:40
at new NodeError (node:internal/errors:393:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1026:11)
at defaultResolve (node:internal/modules/esm/resolve:1106:3)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.
It seems this is a general issue of several plugins, although I can tell that nuxt-icon
, @vueuse/nuxt
and intlify/nuxt3
work fine.
I'll link the related issue that I found from other plugins: https://github.com/dargmuesli/nuxt-cookie-control/issues/14, https://github.com/nuxt-community/robots-module/issues/86.
@ennioVisco did you found a solution to your problem?
Same error with (https://github.com/dargmuesli/nuxt-cookie-control). Any solution?
@ennioVisco did you found a solution to your problem?
I just removed the plugin :/
Would you check whether the problem reproduces with the latest nuxt edge and nitropack edge?
Would you check whether the problem reproduces with the latest nuxt edge and nitropack edge?
Unfortunately doesn't seem to work (same error) with @nuxtjs/robots
with:
- Operating System:
Windows_NT
- Node Version:
v16.13.1
- Nuxt Version:
3.0.1-rc.0-27898092.1e8da22
- Nitro Version:
2.0.0-27898373.d89fa5f
- Package Manager:
[email protected]
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
When they are going to release this solution, it is a blocker to install third-party modules. @danielroe
https://github.com/wobsoriano/nuxt-remote-fn is also affected
But the issue appears to be resolved on the edge channel, at least for this module
- Operating System:
Windows 10
- Node Version:
v18.13.0
- Nuxt Version:
3.0.1-rc.0-27898092.1e8da22
- Nitro Version:
2.0.0-27898373.d89fa5f
- Package Manager:
[email protected]
- Builder:
vite
- User Config:
-
- Runtime Modules:
[email protected]
- Build Modules:
-
I've got a PR on @dargmuesli/nuxt-cookie-control
which might not fix the root cause, I'm unsure. Just mentioning it in case it helps: https://github.com/dargmuesli/nuxt-cookie-control/pull/22/files
I've got a PR on
@dargmuesli/nuxt-cookie-control
which might not fix the root cause, I'm unsure. Just mentioning it in case it helps: https://github.com/dargmuesli/nuxt-cookie-control/pull/22/files
Amazing catch @dargmuesli!
This clarifies that it's an issue of nuxt-kit's resolvePath
: https://github.com/nuxt/nuxt/blob/1211f62d41b54592dd3bc0d9db62ef9ca0296177/packages/kit/src/resolve.ts#L29
which is in fact using normalize
from unjs/pathe
: https://github.com/unjs/pathe/blob/main/src/path.ts#L22.
I just pushed the issue upwards there :) https://github.com/unjs/pathe/issues/117
me too with NUXT 3.1.0
Hi, getting the same problem here.
Nuxi 3.1.1 18:50:45
18:50:46
RootDir: C:/Users/inmor/Documents/Proyectos/Naeko/dashboard 18:50:46
Nuxt project info: 18:50:46
------------------------------
- Operating System: `Windows_NT`
- Node Version: `v19.3.0`
- Nuxt Version: `3.1.1`
- Nitro Version: `2.1.0`
- Package Manager: `[email protected]`
- Builder: `vite`
- User Config: `modules`, `css`, `htmlValidator`, `app`, `runtimeConfig`, `colorMode`, `security`, `i18n`
- Runtime Modules: `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxtjs/[email protected]`, `@nuxt/[email protected]`, `[email protected]`, `[email protected]`, `@nuxtjs/[email protected]`, `[email protected]`
- Build Modules: `-`
------------------------------
I've got a PR on
@dargmuesli/nuxt-cookie-control
which might not fix the root cause, I'm unsure. Just mentioning it in case it helps: https://github.com/dargmuesli/nuxt-cookie-control/pull/22/filesAmazing catch @dargmuesli!
This clarifies that it's an issue of nuxt-kit's
resolvePath
:https://github.com/nuxt/nuxt/blob/1211f62d41b54592dd3bc0d9db62ef9ca0296177/packages/kit/src/resolve.ts#L29
which is in fact using
normalize
fromunjs/pathe
: https://github.com/unjs/pathe/blob/main/src/path.ts#L22.I just pushed the issue upwards there :) unjs/pathe#117
It works! Thnx!
With which plugin it works? I'm still backtracking the changes to nuxt kit and pathe in order to find the exact cause of the issue, but I cannot find it yet :/
I tried to run nuxt 3.2.0 with nuxt-cookie-control... nuxt starts, but when i append CookieControl component on page, it crashes.. after fix path does not contain slashes... exploring an error...
Would you guys please try nuxt v3.2.3
(and @dargmuesli/nuxt-cookie-module v5.0.1
) and report if fixes in those releases resolve this issue as well?
Would you guys please try
nuxt v3.2.3
(and@dargmuesli/nuxt-cookie-module v5.0.1
) and report if fixes in those releases resolve this issue as well?
It doesn't work with nuxtjs/robots (I cannot tell about nuxt-cookie, but at some point I'll integrate it as well).
nuxt 3.2.3 with nuxt-mail still have this problem
nuxt 3.2.3 with nuxt-mail still have this problem
Same with nuxt 3.2.3 and @dargmuesli/nuxt-cookie-control