I've encountered a perplexing error that has me stumped.
The error reared its head while attempting to build with --prod. Despite my efforts to fix it by updating dependencies, when I run
ionic cordova build android --prod --verbose
, the following error message pops up:
typescript error 'ion-icon' is not a known element: 1. If 'ion-icon' is an Angular component, then verify that it is part of this module. ("> [ERROR ->]")
'ion-buttons' is not a known element: 1. If 'ion-buttons' is an Angular component, then verify that it is part of this module. (" [ERROR ->]")
'ion-col' is not a known element: 1. If 'ion-col' is an Angular component, then verify that it is part of this module. (" [ERROR ->]")
Error: The Angular AoT build failed. See the issues above Error: The Angular AoT build failed. See the issues above at C:\Users\ceman\Desktop\idem-app-updated-master\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:237:55 at step (C:\Users\ceman\Desktop\idem-app-updated-master\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:32:23) at Object.next (C:\Users\ceman\Desktop\idem-app-updated-master\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:13:53) at fulfilled (C:\Users\ceman\Desktop\idem-app-updated-master\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:4:58) [ERROR] Command not found: ionic-app-scripts ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms ionic:cli-framework:utils:process onBeforeExit handler: running 1 queued functions +0ms ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 127) +0ms
These are some of my files; let me know if you need more information:
app.module.ts: https://pastebin.com/TXQ4tDFM
package.json: https://pastebin.com/kAK5eK5Z
This is the configuration from ionic info
:
Ionic:
ionic (Ionic CLI) : 4.0.0-rc.9 (C:\Users\ceman\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : ionic-angular 3.9.2 @ionic/app-scripts : 3.1.10
Cordova:
cordova (Cordova CLI) : not installed Cordova Platforms : android 7.1.0
System:
Android SDK Tools : 26.1.1 NodeJS : v6.14.3 (P:\nodejs\node.exe) npm : 6.1.0 OS : Windows 10
Environment:
ANDROID_HOME : P:\Android\sdk
As an additional detail, I tried upgrading to Node 8 in hopes of resolving the issue, but reverted back to version 6 as it didn't have any effect.