Search code examples
angularwebpackwebpack-5

TypeError: __webpack_require__.h is not a function


I have upgraded from angular 12 to angular 13. Now after upgrading when I tries to run my application. It runs perfectly but in console it is getting the error.

index.js:37 Uncaught TypeError: __webpack_require__.h is not a function
at Module.38202 (index.js:37:58)
at __webpack_require__ (bootstrap:19:1)
at __webpack_exec__ (styles.css?231c:1:1)
at styles.css?231c:1:1
at webpackJsonpCallback (jsonp chunk loading:71:1)
at styles.js:1:109

Can anyone help me to resolve this error.


Solution

  • Deleting the contents of my compiled JavaScript output directory (dist/ is default) before rebuilding the Angular/TypeScript files solved the issue for me.

    I had the same issue developing an Angular/ASP.NET Core site and it was preventing IISExpress from serving updated files as well as hot reloading (very annoying during development).