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

Module build failed: UnhandledSchemeError: Reading from "node:child_process" is not handled by plugins (Unhandled scheme) #50

Closed
felixhao28 opened this issue Aug 6, 2021 · 2 comments

Comments

@felixhao28
Copy link

Using webpack 5.36.1 results in an error since os-locale 6.0.0

ERROR in node:child_process
Module build failed: UnhandledSchemeError: Reading from "node:child_process" 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.
    at D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:742:26
    at Hook.eval [as callAsync] (eval at create (D:\projects\tfnative2\jsserver\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Object.processResource (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:739:9)
    at processResource (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:220:11)
    at iteratePitchingLoaders (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:171:10)
    at runLoaders (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:397:2)
    at NormalModule.doBuild (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:729:3)
    at NormalModule.build (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:878:15)
    at D:\projects\tfnative2\jsserver\node_modules\webpack\lib\Compilation.js:1311:12
    at NormalModule.needBuild (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:1143:32)
 @ ./node_modules/os-locale/exec.js 4:0-46 6:27-48 27:8-33
 @ ./node_modules/os-locale/index.js 2:0-41 8:15-19 12:8-16
 @ ./src/config.ts
 @ ./src/index.ts 16:17-36

ERROR in node:util
Module build failed: UnhandledSchemeError: Reading from "node:util" 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.
    at D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:742:26
    at Hook.eval [as callAsync] (eval at create (D:\projects\tfnative2\jsserver\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D:\projects\tfnative2\jsserver\node_modules\tapable\lib\Hook.js:18:14)
    at Object.processResource (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:739:9)
    at processResource (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:220:11)
    at iteratePitchingLoaders (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:171:10)
    at runLoaders (D:\projects\tfnative2\jsserver\node_modules\loader-runner\lib\LoaderRunner.js:397:2)
    at NormalModule.doBuild (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:729:3)
    at NormalModule.build (D:\projects\tfnative2\jsserver\node_modules\webpack\lib\NormalModule.js:878:15)
    at D:\projects\tfnative2\jsserver\node_modules\webpack\lib\Compilation.js:1311:12
 @ ./node_modules/os-locale/exec.js 3:0-36 6:17-26
 @ ./node_modules/os-locale/index.js 2:0-41 8:15-19 12:8-16
 @ ./src/config.ts
 @ ./src/index.ts 16:17-36
@sindresorhus
Copy link
Owner

This is a problem with Webpack. You need to open an issue over there instead.

@felixhao28
Copy link
Author

My point is you are using "node:util" instead of "util" which breaks compatibility on older versions of build tools and NodeJS itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants