Description
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: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
With Angular 12, this is working fine in Angular 11
Angular CLI: 12.0.0
Node: 14.15.4
Package Manager: npm 6.14.10
OS: darwin x64
Angular:
...
Package Version
@angular-devkit/architect 0.1200.0 (cli-only)
@angular-devkit/core 12.0.0 (cli-only)
@angular-devkit/schematics 12.0.0 (cli-only)
@schematics/angular 12.0.0 (cli-only)
If install util js via npm install util
build error is removed but at runtime getting this error.
util.js:109 Uncaught ReferenceError: process is not defined
at Object.1732 (util.js:109)
internally util js is used by twilio-client sdk
if (process.env.NODE_DEBUG) {
var debugEnv = process.env.NODE_DEBUG;
debugEnv = debugEnv.replace(/[|\{}()[]^$+?.]/g, '\$&')
.replace(/*/g, '.*')
.replace(/,/g, '$|^')
.toUpperCase();
debugEnvRegex = new RegExp('^' + debugEnv + '$', 'i');
}
here at the client-side its try to get process object that is node server object. this is causing the issue in angular 12