nx icon indicating copy to clipboard operation
nx copied to clipboard

UnhandledSchemeError for node:path after upgrading from 21.1.2 to 21.1.3

Open artur1989 opened this issue 5 months ago • 2 comments

Current Behavior

After updating Nx from version 21.1.2 to 21.1.3, the Angular application fails to compile. The console displays the following error:

node:path - Error: Module build failed: UnhandledSchemeError: Reading from "node:path" 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.

Despite this, the Angular Live Development Server still starts and listens on http://localhost:4200, but the app does not render correctly due to the failed compilation.

Expected Behavior

The application should compile and run successfully, as it did in version 21.1.2, without throwing any errors related to node: URIs or Webpack plugin handling.

GitHub Repo

No response

Steps to Reproduce

  1. Update Nx from 21.1.2 to 21.1.3
  2. Run nx serve or ng serve for an Angular application
  3. Observe the terminal output showing a Webpack UnhandledSchemeError for node:path
  4. The app fails to compile

Nx Report

Node           : 20.12.2
OS             : linux-x64
Native Target  : x86_64-linux
yarn           : 4.5.3

nx                     : 21.1.3
@nx/js                 : 21.1.3
@nx/jest               : 21.1.3
@nx/eslint             : 21.1.3
@nx/workspace          : 21.1.3
@nx/angular            : 21.1.3
@nx/devkit             : 21.1.3
@nx/eslint-plugin      : 21.1.3
@nx/module-federation  : 21.1.3
@nx/node               : 21.1.3
@nx/playwright         : 21.1.3
@nx/rspack             : 21.1.3
@nx/web                : 21.1.3
@nx/webpack            : 21.1.3
typescript             : 5.7.3
---------------------------------------
Registered Plugins:
@nx/playwright/plugin
@nx/eslint/plugin
---------------------------------------
Community plugins:
@ng-bootstrap/ng-bootstrap : 16.0.0
@ngrx/component-store      : 19.2.1
@ngrx/effects              : 19.2.1
@ngrx/entity               : 19.2.1
@ngrx/operators            : 19.2.1
@ngrx/router-store         : 19.2.1
@ngrx/schematics           : 19.2.1
@ngrx/store                : 19.2.1
@ngrx/store-devtools       : 19.2.1
---------------------------------------
Cache Usage: 0.00 B / 186.14 GB

Failure Logs

node:path - Error: Module build failed: UnhandledSchemeError: Reading from "node:path" 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.   
                                                                                                                                                                           
  ✖ Failed to compile.                                                                                                                                                                                                                  
  ✔ Browser application bundle generation complete.

Package Manager Version

yarn 4.5.3

Operating System

  • [ ] macOS
  • [x] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

This issue seems related to Webpack’s lack of default support for node: protocol in certain module imports. Possibly a new dependency or a build configuration change in Nx 21.1.3 is triggering this. The error disappears when downgrading to 21.1.2.

artur1989 avatar Jun 12 '25 09:06 artur1989