Search code examples
angularionic-frameworktypeerrorcapacitor

Angular Ionic Capacitor build prod: TypeError Cannot read property of 'updateClassDeclaration' of undefined


About 15 minutes ago I was not getting this error, but after running npx audit fix --force this error occurs when running npm run build in my Ionic capacitor project:

Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/@ngtools/webpack/src/ivy/index.js):
TypeError: Cannot read property 'updateClassDeclaration' of undefined
    at visitNode

Ionic Info:

Ionic:

   Ionic CLI                     : 6.13.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.2
   @angular-devkit/build-angular : 0.1102.6
   @angular-devkit/schematics    : 10.2.3
   @angular/cli                  : 10.2.3
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.4.5
   @capacitor/core : 2.4.5

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res (update available: 0.15.3) : 0.15.2
   native-run (update available: 1.3.0)   : 0.2.8

System:

   NodeJS : v12.15.0 (/usr/local/bin/node)
   npm    : 7.6.3
   OS     : macOS Catalina

Thanks.


Solution

  • Welp, no luck with fixing. I reverted back to its original state in a backed-up folder and didn't use the npx audit fix --force commands. Be sure to always backup your important project files!