Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto package not support any more #226

Open
faezegholami opened this issue Feb 27, 2023 · 2 comments
Open

crypto package not support any more #226

faezegholami opened this issue Feb 27, 2023 · 2 comments

Comments

@faezegholami
Copy link

hi
i installed this package and get this error.

ERROR in ./node_modules/node-rsa/src/NodeRSA.js 10:12-29

Module not found: Error: Can't resolve 'crypto' in 'C:\Users\f.gholami\Desktop\faraEtebarLogin\my-app\node_modules\node-rsa\src'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }

when i searched for crypto found out crypto package didn't support any more.
what do i do?

@rohitk0
Copy link

rohitk0 commented Oct 12, 2023

the solution is in error.
Step 1: install 'crypto-browserify'
Step 2: add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") } in your webpack configuration file (as you are using node-rsa and node-rsa uses crypto , you need to add its polyfill ).

@golontico
Copy link

Hello even when i do it the problem persist

module.exports = {
    // Existing configuration options
    resolve: {
      // Other resolve options...
      fallback: { "crypto": require.resolve("crypto-browserify") },
    },
  };

etc1@MacBook-Pro app % npm list crypto-browserify
app /Users/path/compassapp
└── crypto-browserify@3.12.0

Please give a hand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants