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 file and data URLs are supported by the default ESM loader

See original GitHub issue

I’m trying to use the directory import plugin as listed in the wiki, and it does work in develop mode (wmr build).

But when running wmr build --prerender it’s throwing an resolve error:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:724:11)
    at Loader.resolve (internal/modules/esm/loader.js:97:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:50:40)
    at link (internal/modules/esm/module_job.js:49:36)

Is this a known limitation? Or is there perhaps something that I can do to fix this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
marvinhagemeistercommented, Jun 19, 2021

This was resolved with #600. Updating to a recent version of @wmrjs/directory-import fixes it 👍

1reaction
jorbuedocommented, Jan 29, 2021

No edits. Stright from the repo:

example-wmr
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file ...
ERROR Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths ...
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 >
Bud build throws "Only file and data URLs are supported by ...
22.19 $ bud build Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid...
Read more >
ECMAScript modules | Node.js v19.3.0 Documentation
A specifier like 'https://example.com/app.js' is not supported natively in Node.js unless using a custom HTTPS loader. file: URLs#. Modules are loaded multiple ...
Read more >
Lab 7.1 ERR_UNSUPPORTED_ESM_URL_SCHEME
... Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs.
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