You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you get error Error in bail mode: Error: callback(): The callback was already called when running npm run build then you need to set the NODE_OPTIONS environment variable to include --openssl-legacy-provider.
Details
I created a test project by running node .../src/github/userscripter/bin/cli.js init followed by running npm install and npm run build, and the build command failed with
ℹ 「atl」: Using tsconfig.json from .../userscript/test1/tsconfig.json
Error in bail mode: Error: callback(): The callback was already called.
at context.callback (.../userscript/test1/node_modules/loader-runner/lib/LoaderRunner.js:106:10) Error: callback(): The callback was already called.
at context.callback (.../userscript/test1/node_modules/loader-runner/lib/LoaderRunner.js:106:10)
After making some debug modifications to node_modules/loader-runner/lib/LoaderRunner.js I noticed the following in the debug output
error: ModuleParseError: Module parse failed: error:0308010C:digital envelope routines::unsupported
File was processed with these loaders:
* ./node_modules/awesome-typescript-loader/dist/entry.js
* ./node_modules/restrict-imports-loader/dist/index.js
You may need an additional loader to handle the result of these loaders.
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:130:10)
at module.exports (.../userscript/test1/node_modules/webpack/lib/util/createHash.js:135:53)
at NormalModule._initBuildHash (.../userscript/test1/node_modules/webpack/lib/NormalModule.js:417:16)
at handleParseResult (.../userscript/test1/node_modules/webpack/lib/NormalModule.js:477:10)
at .../userscript/test1/node_modules/webpack/lib/NormalModule.js:500:6
at .../userscript/test1/node_modules/webpack/lib/NormalModule.js:358:12
...
which matched the part about "digital envelope routines::unsupported" from this comment, and when I ran
env NODE_OPTIONS=--openssl-legacy-provider npm run build
then the build succeeded.
$ npm --version
9.6.0
$ node --version
v16.18.1
The text was updated successfully, but these errors were encountered:
Awesome! That's been a major pain point for me as well lately. I don't remember exactly what the context was, but the next time I face this error, I'll keep this issue in mind!
TL;DR
If you get error
Error in bail mode: Error: callback(): The callback was already called
when runningnpm run build
then you need to set theNODE_OPTIONS
environment variable to include--openssl-legacy-provider
.Details
I created a test project by running
node .../src/github/userscripter/bin/cli.js init
followed by runningnpm install
andnpm run build
, and the build command failed withAfter making some debug modifications to
node_modules/loader-runner/lib/LoaderRunner.js
I noticed the following in the debug outputwhich matched the part about "digital envelope routines::unsupported" from this comment, and when I ran
then the build succeeded.
The text was updated successfully, but these errors were encountered: