1
votes

I'm getting this error when running ng build --prod in angular.

ERROR in ./node_modules/angular-file/fesm2015/angular-file.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined

I don't know whats causing this and how to resolve this.

enter image description here

1

1 Answers

0
votes

TypeScript <= 3.6.3 presents this issue

If you install 3.7 (dev or the new beta), it will compile fine.

Note: if you receive an ERROR on building, regarding the TS version, just disable it via tsconfig. For that use disableTypeScriptVersionCheck

"angularCompilerOptions": {
  "disableTypeScriptVersionCheck": true
},
"compilerOptions": {
 ...

Edited:

Change the angular-devkit version to "0.803.8" (yours seems outdated) and angular/cli at "8.3.8".

Hope this helps :)

[Reference] - Angular cli build prod: TypeError: Cannot read property 'kind' of undefined