Environment
- Operating System: Microsoft Windows NT 10.0.26200.0
- Node Version: v22.22.2
- npm Version: 10.9.7
- Nuxt Version: 4.4.8
- Nitro Version: 2.13.4
- Vite Version: 7.3.6
- Vue Version: 3.5.35
- Builder: vite
Reproduction
Enable legacyExternals on a windows machine running nuxt version 4.4.8 and possibly node version 22.22.2
nitro: {
experimental: {
legacyExternals: true,
},
}
Simply run npm run dev and inspect the localhost:3000 page for errors.
Describe the bug
On Windows, enabling Nitro legacy externals causes Nuxt to generate a raw absolute Windows path in .nuxt/dev/index.mjs:
import _... from 'C:/.../node_modules/@nuxt/vite-builder/dist/fix-stacktrace'
Node treats C: as an unsupported URL scheme and fails with:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Expected behavior
Nuxt should emit a valid file URL on Windows, for example:
import _... from 'file:///C:/.../node_modules/@nuxt/vite-builder/dist/fix-stacktrace.mjs'
Environment
Reproduction
Enable
legacyExternalson a windows machine running nuxt version4.4.8and possibly node version22.22.2Simply run
npm run devand inspect the localhost:3000 page for errors.Describe the bug
On Windows, enabling Nitro legacy externals causes Nuxt to generate a raw absolute Windows path in
.nuxt/dev/index.mjs:Node treats
C:as an unsupported URL scheme and fails with:Expected behavior
Nuxt should emit a valid file URL on Windows, for example: