I am experiencing an issue when I try to build using the --prod flag. Here is what I get:
[11:10:54] ionic-app-scripts 1.1.4
[11:10:54] build prod started …
[11:10:54] clean started …
[11:10:54] clean finished in 18 ms
[11:10:54] copy started …
[11:10:54] ngc started …
[11:11:07] build prod failed: Cannot determine the module for class SummaryPage in
[11:11:07] ionic-app-script task: “build”
[11:11:07] Error: Cannot determine the module for class SummaryPage in
Error: Cannot determine the module for class SummaryPage in /Users/Britt/Desktop/Apps/cnh2/src/pages/summary/summary.ts!
at analyzeAndValidateNgModules (/Users/Britt/Desktop/Apps/cnh2/node_modules/@angular/compiler/bundles/compiler.umd.js:12707:17)
at OfflineCompiler.compileModules (/Users/Britt/Desktop/Apps/cnh2/node_modules/@angular/compiler/bundles/compiler.umd.js:12775:20)
at CodeGenerator.codegen (/Users/Britt/Desktop/Apps/cnh2/node_modules/@angular/compiler-cli/src/codegen.js:58:30)
at Object.runCodegen (/Users/Britt/Desktop/Apps/cnh2/node_modules/@ionic/app-scripts/dist/aot/codegen/codegen-ng22.js:15:26)
at Object.doCodegen (/Users/Britt/Desktop/Apps/cnh2/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:31)
npm ERR! Darwin 15.6.0
npm ERR! argv “/usr/local/bin/node” “/usr/local/bin/npm” “run” “ionic:build” “–” “–prod” "–release"
npm ERR! node v6.10.1
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ ionic:build:
ionic-app-scripts build "--prod" "--release"
npm ERR! Exit status 1
npm ERR! Failed at the ionic-hello-world@ ionic:build script ‘ionic-app-scripts build “–prod” “–release”’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build “–prod” "–release"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Britt/Desktop/Apps/cnh2/npm-debug.log
I have tried to uninstall npm, cordova, and Ionic, and install… this has not changed the error message.
I am using Ionic 2.2.1, cordova 6.5.0, node js 6.10.1.
I am able to run the app through ionic serve. I can even build it using --release but the app has a delay of 10-15 seconds before starting. I have seen on other posts that using the --prod flag will reduce this delay. I am not able to build using this feature.
Any ideas of what to do??