[ad_1]
Hello!
I bumped into an issue. I imported the library into the undertaking, however I find yourself getting an error after I begin the undertaking:
Error: Current setting doesn't present a require() for requiring 'crypto'.
I’ve tried many options discovered within the documentation and on third-party websites. But nothing labored. How can I clear up this downside?
As I perceive third occasion packages which I import have require() operate which isn’t supported by present setting. But I can’t work out learn how to repair it.
You can discuss with this doc to make use of crypto:
Thanks for the reply, however this answer didn’t assist.
I’ll attempt to inform you extra in regards to the error.
I’m attempting to import @solana/web3.js into the undertaking.
Import * as solanaWeb3 from "@solana/web3.js";
But as quickly as I attempt to use the instance from the documentation:
console.log(solanaWeb3);
An error happens (it’s seen with the developer instruments within the browser):
Error: Current setting doesn't present a require() for requiring 'crypto'.
manufacturing unit cjs-loader.mjs:93
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
_createRequire cjs-loader.mjs:105
_createRequireWithResolveMap cjs-loader.mjs:112
execute crypto.js:14
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
_createRequire cjs-loader.mjs:105
_createRequireWithResolveMap cjs-loader.mjs:112
execute utils.js:33
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
_createRequire cjs-loader.mjs:105
_createRequireWithResolveMap cjs-loader.mjs:112
execute _sha2.js:16
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
_createRequire cjs-loader.mjs:105
_createRequireWithResolveMap cjs-loader.mjs:112
execute sha512.js:19
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
_createRequire cjs-loader.mjs:105
_createRequireWithResolveMap cjs-loader.mjs:112
execute index.cjs.js:107
_load cjs-loader.mjs:78
_tryModuleLoad cjs-loader.mjs:63
_require cjs-loader.mjs:42
require cjs-loader.mjs:27
execute index.cjs.mjs:7
doExec system.js:482
postOrderExec system.js:472
postOrderExec system.js:461
postOrderExec system.js:459
postOrderExec system.js:461
postOrderExec system.js:459
C system.js:406
If you wish to use web3, please refer right here.
[ad_2]