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
Just noting this to get back around to it later... the no crypto support error stack is a bit unfortunate as it contains internal details that just aren't helpful for the user:
Really, anything above the node:crypto frame is useless information in these stacks (commonjs or ESM)
> require('crypto')
Uncaught Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support
at new NodeError (node:internal/errors:329:5)
at assertCrypto (node:internal/util:128:11)
at node:crypto:36:1
at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:283:7)
at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:225:10)
at loadNativeModule (node:internal/modules/cjs/helpers:39:9)
at Function.Module._load (node:internal/modules/cjs/loader:787:15)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:92:18)
at REPL1:1:1 {
code: 'ERR_NO_CRYPTO'
}
> .exit
root@DESKTOP-5KK9VIR:~/node/node-check# ./node ../tmp/a.mjs
node:internal/process/esm_loader:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_NO_CRYPTO]: Node.js is not compiled with OpenSSL crypto support
at new NodeError (node:internal/errors:329:5)
at assertCrypto (node:internal/util:128:11)
at node:crypto:36:1
at NativeModule.compileForInternalLoader (node:internal/bootstrap/loaders:283:7)
at NativeModule.compileForPublicLoader (node:internal/bootstrap/loaders:225:10)
at loadNativeModule (node:internal/modules/cjs/helpers:39:9)
at Loader.builtinStrategy (node:internal/modules/esm/translators:285:18)
at new ModuleJob (node:internal/modules/esm/module_job:44:26)
at Loader.getModuleJob (node:internal/modules/esm/loader:246:11)
at async ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:59:21) {
code: 'ERR_NO_CRYPTO'
}
The text was updated successfully, but these errors were encountered:
I would really go so far as to argue that our approach to throwing the error on load here is unfortunate and should change, largely because there is no equivalent way to catch the error when using ESM. If the module is there, we should allow it to load with the expected API surface but have the functions disabled when crypto support is not included. OR, we should allow the module to load with none of the actual APIs present.
targos
added
crypto
Issues and PRs related to the crypto subsystem.
errors
Issues and PRs related to JavaScript errors originated in Node.js core.
labels
Mar 3, 2021
Just noting this to get back around to it later... the no crypto support error stack is a bit unfortunate as it contains internal details that just aren't helpful for the user:
Really, anything above the
node:crypto
frame is useless information in these stacks (commonjs or ESM)The text was updated successfully, but these errors were encountered: