Closed chunhoong closed 7 years ago
I have same issue with one of my projects.
npm run ionic:build --aot --verbose
npm run ionic:build --aot --verbose
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/6.4.0/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'run',
npm verb cli 'ionic:build',
npm verb cli '--aot',
npm verb cli '--verbose' ]
npm info using npm@3.10.6
npm info using node@v6.4.0
npm verb run-script [ 'preionic:build', 'ionic:build', 'postionic:build' ]
npm info lifecycle moba_quiz@2.0.0~preionic:build: moba_quiz@2.0.0
npm info lifecycle moba_quiz@2.0.0~ionic:build: moba_quiz@2.0.0
> moba_quiz@2.0.0 ionic:build /Users/krykowski/workspace/moba_quiz
> ionic-app-scripts build
[10:59:09] ionic-app-scripts 0.0.47
[10:59:09] build dev started ...
[10:59:09] clean started ...
[10:59:09] clean finished in 6 ms
[10:59:09] copy started ...
[10:59:09] ngc started ...
[10:59:21] ngc finished in 11.98 s
[10:59:21] webpack started ...
[10:59:22] copy finished in 13.18 s
npm verb lifecycle moba_quiz@2.0.0~ionic:build: unsafe-perm in lifecycle true
npm verb lifecycle moba_quiz@2.0.0~ionic:build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/krykowski/workspace/moba_quiz/node_modules/.bin:/usr/local/Cellar/node/6.4.0/bin:/Users/krykowski/workspace/moba_quiz/parsers/bin:/opt/local/bin:/opt/local/sbin:/usr/local/lib/dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1/bin:/Users/krykowski/.dnx/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/krykowski/Library/Android/sdk/platform-tools:/Users/krykowski/Library/Android/sdk/tools:/Users/krykowski/Library/Android/sdk/platform-tools:/Users/krykowski/Library/Android/sdk/build-tools/25.0.0
npm verb lifecycle moba_quiz@2.0.0~ionic:build: CWD: /Users/krykowski/workspace/moba_quiz
npm info lifecycle moba_quiz@2.0.0~postionic:build: moba_quiz@2.0.0
npm verb exit [ 0, true ]
npm info ok
Then the www/build/
dir contains only polyfills.js
. The output of other project which builds properly looks like this:
npm info it worked if it ends with ok
npm verb cli [ '/usr/local/Cellar/node/6.4.0/bin/node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'run',
npm verb cli 'ionic:build',
npm verb cli '--aot',
npm verb cli '--verbose' ]
npm info using npm@3.10.6
npm info using node@v6.4.0
npm verb run-script [ 'preionic:build', 'ionic:build', 'postionic:build' ]
npm info lifecycle zgadula@~preionic:build: zgadula@
npm info lifecycle zgadula@~ionic:build: zgadula@
> zgadula@ ionic:build /Users/krykowski/workspace/party_game
> ionic-app-scripts build
[11:01:09] ionic-app-scripts 0.0.47
[11:01:09] build dev started ...
[11:01:09] clean started ...
[11:01:09] clean finished in 2 ms
[11:01:09] copy started ...
[11:01:09] ngc started ...
[11:01:18] ngc finished in 9.41 s
[11:01:18] webpack started ...
[11:01:19] copy finished in 10.46 s
[11:01:33] webpack finished in 15.26 s
[11:01:33] sass started ...
[11:01:35] sass finished in 1.84 s
[11:01:35] build dev finished in 26.54 s
npm verb lifecycle zgadula@~ionic:build: unsafe-perm in lifecycle true
npm verb lifecycle zgadula@~ionic:build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/krykowski/workspace/party_game/node_modules/.bin:/usr/local/Cellar/node/6.4.0/bin:/Users/krykowski/workspace/moba_quiz/parsers/bin:/opt/local/bin:/opt/local/sbin:/usr/local/lib/dnx/runtimes/dnx-coreclr-darwin-x64.1.0.0-rc1-update1/bin:/Users/krykowski/.dnx/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/krykowski/Library/Android/sdk/platform-tools:/Users/krykowski/Library/Android/sdk/tools:/Users/krykowski/Library/Android/sdk/platform-tools:/Users/krykowski/Library/Android/sdk/build-tools/25.0.0
npm verb lifecycle zgadula@~ionic:build: CWD: /Users/krykowski/workspace/party_game
npm info lifecycle zgadula@~postionic:build: zgadula@
npm verb exit [ 0, true ]
npm info ok
I have no idea what's wrong with the first project (it's much bigger) as they use same version of the ionic/cli/app-scripts etc. Any ideas?
@vintage may I know what cordova version are you using?
@rephchunhoong
Here's my ionic info & ionic platform list:
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: 1.9.0
ios-sim version: 5.0.6
OS: macOS Sierra
Node Version: v6.4.0
Xcode version: Xcode 8.1 Build version 8B62
Installed platforms:
android 6.1.0
ios 4.3.1
Available platforms:
amazon-fireos ~3.6.3 (deprecated)
blackberry10 ~3.8.0
browser ~4.1.0
firefoxos ~3.6.3
osx ~4.0.1
webos ~3.7.0
Both apps gives the same output.
I'm also including installed dependencies, maybe it's some problem with any of them? Still debugging, but didn't find anything interesting yet.
npm dependencies from non-working app:
npm ls --depth=0
moba_quiz@2.0.0 /Users/krykowski/workspace/moba_quiz
├── @angular/common@2.2.1
├── @angular/compiler@2.2.1
├── @angular/compiler-cli@2.2.1
├── @angular/core@2.2.1
├── @angular/forms@2.2.1
├── @angular/http@2.2.1
├── @angular/platform-browser@2.2.1
├── @angular/platform-browser-dynamic@2.2.1
├── @angular/platform-server@2.2.1
├── @ionic/app-scripts@0.0.47
├── @ionic/storage@1.1.6
├── @types/lodash@4.14.37
├── crypto-js@3.1.8
├── ionic-angular@2.0.0-rc.4
├── ionic-native@2.2.11
├── ionicons@3.0.0
├── lodash@4.16.1
├── ng2-translate@3.1.2
├── raven-js@3.7.0
├── rxjs@5.0.0-beta.12
├── typescript@2.0.9
└── zone.js@0.6.26
npm dependencies from working app:
npm ls --depth=0
zgadula@ /Users/krykowski/workspace/party_game
├── @angular/common@2.2.1
├── @angular/compiler@2.2.1
├── @angular/compiler-cli@2.2.1
├── @angular/core@2.2.1
├── @angular/forms@2.2.1
├── @angular/http@2.2.1
├── @angular/platform-browser@2.2.1
├── @angular/platform-browser-dynamic@2.2.1
├── @angular/platform-server@2.2.1
├── @ionic/app-scripts@0.0.47
├── @ionic/storage@1.1.6
├── @types/lodash@4.14.37
├── ionic-angular@2.0.0-rc.4
├── ionic-native@2.2.11
├── ionicons@3.0.0
├── lodash@4.16.1
├── rxjs@5.0.0-beta.12
├── typescript@2.0.9
└── zone.js@0.6.26
Hi @vintage,
I see you are using ng2-translate too. Is there any chance it breaks the thing?
-ChunHoong-
@rephchunhoong I'll try later this today (or tomorrow morning) add ng2-translate to my working app and see if it breaks the build process. Will ping you when got further details.
I see you are using ng2-translate too. Is there any chance it breaks the thing?
We don't use ng2-translate, but we also face this issue. serve
works for development but we cannot build
or serve
with the --prod
or --aot
flag.
Thanks for letting us know, then it have to be something else. I just don't understand one thing - look at this output:
[10:59:21] webpack started ...
[10:59:22] copy finished in 13.18 s
npm verb lifecycle moba_quiz@2.0.0~ionic:build: unsafe-perm in lifecycle true
It doesn't print that webpack finished
, so why is that? It seems that process has been aborted somehow, but there is no exception message anywhere about it (and overall build finish with "ok"). Can you confirm it works same for you guys @rephchunhoong @NoNameProvided ?
@vintage for us webpack finishes, below is the output of ionic serve --prod --verbose
This creates a working version of the app, but the --prod
flag is not respected and the main.js
not compiled with aot neither minified.
@NoNameProvided although i'd suspected, it seems like ng2-translate is not the cause as everything is still fine when i install ng2-module into a fresh vanilla ionic project.
Hi @vintage,
So do I. It seems like something is not completed in between, while eventually it still print "build successfully"
Reference
Additional Looks like when --prod flag is enabled, I don't see any alert message from the linter as well.
@rephchunhoong Got it! I've fixed my project by setting up this line https://github.com/driftyco/ionic-conference-app/blob/master/tsconfig.json#L4 to false
. Let me know if it solves your problem too.
Sorry @vintage, but that doesn't help.
Got it! I've fixed my project by setting up this line https://github.com/driftyco/ionic-conference-app/blob/master/tsconfig.json#L4 to false.
It's not a fix for me also.
@NoNameProvided update to 0.0.48 solved my problem.
@rephchunhoong It doesnt fix it for me I have opened a new issue in #588
This should be resolved now.
Thanks, Dan
Note: for support questions, please use one of these channels:
https://forum.ionicframework.com/ http://ionicworldwide.herokuapp.com/
Short description of the problem:
main.js, main.js.map and main.css are not generated when --prod is used during build. Tested with --aot as well, so it should be related to only AoT. "ionic build android" is working fine though.
I am trying with fresh vanilla ionic project, and it is working well. I am not sure if it is related to my cordova version, as I am using cordova from IBM MobileFirst Platform 7.1 instead of conventional cordova.
What behavior are you expecting?
main.js, main.js.map and main.css should be generated.
Steps to reproduce:
Which @ionic/app-scripts version are you using? 0.0.47
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)
Chrome debugger message