fief-dev / fief-js

Fief client for JavaScript
https://docs.fief.dev/integrate/javascript/
MIT License
8 stars 2 forks source link

Module not found: Error: Can't resolve 'crypto' #3

Closed StephanMeijer closed 1 year ago

StephanMeijer commented 1 year ago

ERROR in ./node_modules/@fief/fief/build/esm/crypto/node.js 2:0-33

Module not found: Error: Can't resolve 'crypto' in '/Users/steve/Projects/StephanMeijer/x/node_modules/@fief/fief/build/esm/crypto'

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 }
su-shubham commented 1 year ago

I am also getting error regarding this content but it got solved after going through some steps :

https://www.alchemy.com/blog/how-to-polyfill-node-core-modules-in-webpack-5

Hope It will help you!

StephanMeijer commented 1 year ago

Not using webpack unfortunately