question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only URLs with a scheme in: file, data are supported by the default ESM loade

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v18.12.1
  • Nuxt Version: 3.0.0
  • Nitro Version: 1.0.0
  • Package Manager: npm@8.19.2
  • Builder: vite
  • User Config: modules, typescript, build, css, vite, runtimeConfig
  • Runtime Modules: nuxt-security@0.7.0
  • 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:’

image

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.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:7
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
ennioViscocommented, Dec 2, 2022

@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!

2reactions
ennioViscocommented, Dec 15, 2022

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: yarn@3.3.0
  • Builder: vite
  • User Config: ssr, runtimeConfig, typescript, css, intlify, modules, alias, vite
  • Runtime Modules: nuxt-icon@0.1.7, @nuxtjs/robots@3.0.0, @vueuse/nuxt@9.6.0, @intlify/nuxt3@0.2.4
  • 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)

Read more comments on GitHub >

github_iconTop 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 ESM loader. On Windows, absolute paths must be valid...
Read more >
Only file and data URLs are supported by the default ESM ...
... Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received...
Read more >
Lab 7.1 ERR_UNSUPPORTED_ESM_URL_SCHEME
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be ...
Read more >
Only file and data URLs are supported by the default ESM ...
The part of Vue containing that bug is the loader for the vue.config.js (or .mjs / .cjs ) configuration file. Vue actually provides...
Read more >
https://nodejs.org/api/esm.md
Outside of those cases, Node.js will use the CommonJS module loader. ... `file:`, `node:`, and `data:` URL schemes are supported.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found