Module not found: Error: Can't resolve '@web3auth/web3auth'

This is the complete error:

WARNING in ./node_modules/moralis/lib/browser/Web3Connector/Web3AuthConnector.js 132:40-69
Module not found: Error: Can't resolve '@web3auth/web3auth' in 'C:\Users\Priyadarsh S S\OneDrive\Desktop\Krate\node_modules\moralis\lib\browser\Web3Connector'       
 @ ./node_modules/moralis/lib/browser/MoralisWeb3.js 101:25-69
 @ ./node_modules/moralis/lib/browser/Parse.js 45:42-66
 @ ./node_modules/moralis/index.js 1:0-50
 @ ./node_modules/react-moralis/lib/index.esm.js 3:0-36 5348:11-24
 @ ./src/index.js 10:0-48 13:33-48

I’m unable to host since this error comes in between that.

You can ignore this warning if you don’t use web3auth.
It’s a warning and not an error.
The dependency is optional, and should only be installed when you use this authentication method.
(it’s not ideal that this warning shows up, and we are looking into ways to prevent this warning from showing. It is caused by our build tools and the fact that it doesn’t handle optional dependencies very well)

In any case, it is a warning and should not result in errors or failing builds. If you’re unable to host, then there might be another issue that is causing that.

It’s showing up as an error though. What’s the right way to add that dependency, I’ve tried but that is leading to more errors.

Any update on this? I have the same issue


any update on this, im having similar issues

you can install that dependency if you don’t want to see that warning

I get a

Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

when I do

maybe you can try different versions

Can you post more details of your project e.g. package.json. If you’re not using Web3Auth, you don’t have to install the package and just ignore the warning.