-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
Bug Report
Affected Package
Angular/Core 12.0.0
Is this a regression?
Yes, the previous version in which this bug was not present was: 11.x.x
Description
You now receive an error while building an angular application regarding node polyfills and Webpack 5
https://i.stack.imgur.com/SpjFk.png
this is because of the following breaking change in Webpack 5
https://webpack.js.org/blog/2020-10-10-webpack-5-release/#automatic-nodejs-polyfills-removed
This breaking change didn't exist in previous versions of angular. We use node class libraries shared across the front and backend.
Minimal Reproduction
https://github.com/wdunn001/polyfill-example
Exception or Error
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: { "assert": require.resolve("assert/") }'
- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "assert": false }
Your Environment
Angular Version:
12.0.0
While this is a known breaking change and is easy to fix with Webpack 5 separately as far as I know it requires third party NPM libraries to fix in Angular which might not be an option for me.