TypeError: Cannot read property 'ngModuleByPipeOrDirective' of undefined

#1

TypeError: Cannot read property ‘ngModuleByPipeOrDirective’ of undefined
at AotCompiler.emitAllImpls (F:\IndiansInCA\node_modules@angular\compiler\bundles\compiler.umd.js:30807:55)
at AngularCompilerProgram.generateFilesForEmit (F:\IndiansInCA\node_modules@angular\compiler-cli\src\transformers\program.js:709:46)
at AngularCompilerProgram._emitRender2 (F:\IndiansInCA\node_modules@angular\compiler-cli\src\transformers\program.js:303:27)
at AngularCompilerProgram.emit (F:\IndiansInCA\node_modules@angular\compiler-cli\src\transformers\program.js:212:22)
at F:\IndiansInCA\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:223:38
at step (F:\IndiansInCA\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:32:23)
at Object.next (F:\IndiansInCA\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:13:53)
at fulfilled (F:\IndiansInCA\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:4:58)

error come only when i build apk

ionic info

cli packages: (F:\IndiansInCA\node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)

local packages:

@ionic/app-scripts : 3.2.2
Cordova Platforms  : android 7.1.4 browser 5.0.4
Ionic Framework    : ionic-angular 3.9.4

System:

Node : v10.15.1
npm  : 6.7.0
OS   : Windows 10

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro
#2

Hi @rajputsachin,

Made a quick Google search and found this solution: https://github.com/ionic-team/ionic-app-scripts/issues/1500#issuecomment-448622777

I hope it helps,
Rodrigo

#4

yes this answer is right .
but go into package.json file and check version there