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

[ERR_UNSUPPORTED_ESM_URL_SCHEME] on windows #121

Closed
ThibaultVlacich opened this issue Nov 6, 2024 · 6 comments · Fixed by #125
Closed

[ERR_UNSUPPORTED_ESM_URL_SCHEME] on windows #121

ThibaultVlacich opened this issue Nov 6, 2024 · 6 comments · Fixed by #125
Assignees
Labels
bug Something isn't working ! important !

Comments

@ThibaultVlacich
Copy link

ThibaultVlacich commented Nov 6, 2024

Environment

Windows + Nuxt 3.14

Reproduction

https://github.com/ThibaultVlacich/nitro-appinsights-windows

npm run build
node .output/server/index.mjs

Describe the bug

[nuxt] [request error] [unhandled] [500] 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:'

Additional context

No response

Logs

No response

@huang-julien
Copy link
Owner

huang-julien commented Nov 6, 2024

Hi 👋 I can't reproduce it on a bare nuxt project. Can you provide a lockfile + the package json please ? Or a stackblitz so i can clone it and run it locally

@ThibaultVlacich
Copy link
Author

ThibaultVlacich commented Nov 10, 2024

I've upgraded nuxt-applicationinsights to 0.7.0, which upgraded nitro-applicationinsights to 0.14.2 and everything is working fine now :)
I'm closing. I was using bun, maybe it had a similar bug as pnpm.

@fristys
Copy link

fristys commented Nov 11, 2024

This is still an issue on Windows, running Node v22.11.0 / npm v10.9.0 and "nuxt-applicationinsights": "^0.7.0"

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:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:227:11)
    at defaultLoad (node:internal/modules/esm/load:109:3)
    at ModuleLoader.load (node:internal/modules/esm/loader:666:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:479:43)
    at #createModuleJob (node:internal/modules/esm/loader:503:36)
    at #getJobFromResolveResult (node:internal/modules/esm/loader:274:34)
    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:242:41) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

@ThibaultVlacich
Copy link
Author

ThibaultVlacich commented Nov 11, 2024

Indeed, still an issue, but only in build mode, not in dev mode anymore.

Here is a repro: https://github.com/ThibaultVlacich/nitro-appinsights-windows

npm run build
node .output/server/index.mjs

@ThibaultVlacich ThibaultVlacich changed the title Broken on windows after 0.14.1 [ERR_UNSUPPORTED_ESM_URL_SCHEME] on windows Nov 11, 2024
@huang-julien
Copy link
Owner

I love windows 🙃 ... i'm going to fix it ASAP after Nuxtnation

@huang-julien
Copy link
Owner

I'm going to release it as a minor (0.15) since I removed #applicationinsights alias.

I'll plan 1.0 with applicationinsights 3 and the usage of opentelemetry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ! important !
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants