When trying to migrate from Angular 14 to 15 we found the next issue after doing a ng update @angular/core@15 @angular/cli@15
and running ng serve:
./node_modules/asmcrypto.js/asmcrypto.all.es8.js:3572:23-40 - Error: Module not found: Error: Can't resolve 'crypto' in 'C:\projects\ms-front\node_modules\asmcrypto.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 }
I read somewhere that we should modify the webpack.config file but our project doesn't have such a file.
Note that crypto-browserify is indeed a dependency of my project and it is already downloaded in node_modules