Categories
JavaScript Answers

How to fix Module not found: Error: Can’t resolve ‘crypto’ with JavaScript?

Spread the love

To fix Module not found: Error: Can’t resolve ‘crypto’ with JavaScript, we add the crypto to the browser section of package.json.

For instance, we write

{
  //...
  "browser": {
    "crypto": false
  }
  //...
}

in package.json to disable the crypto module in the browser environment by setting crypto to false.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *