Skip to content

Can't resolve 'crypto', BREAKING CHANGE: webpack <5 used to include polyfills? #136

Closed as not planned
@dclechok

Description

Hi, I recently installed this package to use in a project, and I'm getting this warning/error:

Module not found: Error: Can't resolve 'crypto' in 'C:\Users\dclec\Documents\Mawa\beyp\front-end\node_modules\bcryptjs\dist'

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 }

I'm currently using Node v14.16.0. I don't know if I need to "include a polyfill", or where (which file(s)) to even add these details.... I'm relatively newer to development, could someone maybe help me understand what is going on and what I can do to fix this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions