0

My project was using @azure/msal-angular. I uninstalled the library and removed all the related imports. On uninstalling the library my build and ng s is failing and showing following error. Kindly help on this

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 }`
S8321
  • 37
  • 1
  • 6

1 Answers1

1

You need to install util

npm i util

in you project, that should resolve the issue If you have custom webpack.config file then add

module.exports = {
  resolve: {
      fallback: {
        util: require.resolve("util/")
      }
  }
};

after updating this if you are still getting error like Uncaught ReferenceError: process is not defined utill.js

Please add below to polyfill.ts file

(window as any).process = { env: { DEBUG: undefined }, };