You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having trouble solving the following build error after updating to Angular 12:
./node_modules/crypto-js/core.js:43:22-39 - Warning: Module not found: Error: Can't resolve 'crypto' in '/XXXX/node_modules/crypto-js'
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 }
These Node.js shims can be provided via TypeScript path mappings if needed in a project.
Please note, however, that libraries should ideally be providing web compatible variants of their libraries that use native browser APIs where possible.
Example path mapping configuration within the application's TypeScript configuration file:
The crypto-browserify and stream-browserify packages will need to be installed within the project.
This issue is also asking for the output of the Webpack configuration generation to be provided so that it can be used independently. Not to be able to modify the existing configuration in-place which is what would be needed based on the Webpack error shown above for the Node.js shim.
Hello,
I am having trouble solving the following build error after updating to Angular 12:
My dependencies:
Any advice?
Thank you very much in advance.
The text was updated successfully, but these errors were encountered: