Skip to content

Module not found: Error: Can't resolve 'crypto' in amazon-cognito-identity-js/es/utils with angular 11 / webpack 4.44.2 #7454

Closed
@hisham

Description

@hisham

Describe the bug

I'm upgrading to angular 11, and I get this warning when running an angular app:

warning: ./node_modules/amazon-cognito-identity-js/es/utils/cryptoSecureRandomInt.js
Module not found: Error: Can't resolve 'crypto' in '/<my_dir>/node_modules/amazon-cognito-identity-js/es/utils'

To Reproduce
Upgrade angular app from 10 to 11.

Expected behavior
No warnings

Additional context
I'm running angular 11.0.5 with webpack 4.44.2

I do see similar issue at #7185 with webpack 5, but this warning seems to happen in webpack 4 as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AngularRelated to Angular 2+

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions