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.

resolve.fallback and resolve.alias do not work with `node:` prefix

See original GitHub issue

Bug report

resolve.fallback and resolve.alias do not work with node: prefix

What is the current behavior?

Module build failed: UnhandledSchemeError: Reading from "node:fs" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.

If the current behavior is a bug, please provide the steps to reproduce.

webpack.config.js

module.exports = {
    mode: "development",
    target: "web",
    entry: "./entry.js",
    resolve: {
      fallback: {
        path: false,
        'node:path': false,
      },
      alias: { 
        path: false,
        'node:path': false,
      }
    }
};

entry.js

import * as mod from "node:fs";

console.log(mod);

What is the expected behavior?

fallback and aliases should work

Other relevant information: webpack version: 5.52.0 Node.js version: any Operating System: any Additional tools: any

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:12
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

9reactions
alexander-akaitcommented, Aug 29, 2022

bump

4reactions
vankopcommented, Nov 8, 2021

on webpack@6 board…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve | webpack
Create aliases to import or require certain modules more easily. ... Setting resolve.alias to false will tell webpack to ignore a module.
Read more >
Webpack resolve.alias breaks import of libraries prefixed with an
I am working on a Vue project where I'm attempting to use VuexORM. Upon initial install, I was getting an odd error: Module...
Read more >
resolve.fallback: { "path": false } - You.com - You.com
Setting resolve.alias to false will tell webpack to ignore a module. ... and resolve.alias do not work with `node:` prefix#14166. Created over 1...
Read more >
Module Resolution or Import Alias: The Final Guide - Raul Melo
Tired to have weird imports? It's time to learn how can you enable aliases to your imports and let code more organized.
Read more >
Resolve - webpack 3 documentation
Have a look at Module Resolution for more explanation of how the resolver works. ... Create aliases to import or require certain modules...
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