Ionic production build fails.
Version info
Angular: 4.1.3 Firebase: 4.3.0 AngularFire: 4.0.0-rc.2 Other (e.g. Ionic/Cordova, Node, browser, operating system): ionic 3.9.2
How to reproduce these conditions
Failing test unit, Plunkr, or JSFiddle demonstrating the problem
Steps to set up and reproduce Started a new project following the guide at [https://github.com/angular/angularfire2/blob/master/docs/Auth-with-Ionic3-Angular4.md]
Doing a dev build with 'ionic build' or testing the app with 'ionic serve' works fine. But as soon as I add the '--prod' switch to the build command, it fails.
Sample data and security rules
<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
Debug output
Error: ./src/pages/login/login.ngfactory.js Module not found: Error: Can't resolve '../../../angularfire2/auth' in 'D:\Makin gChoices.be\MobileApps\Apps\OHAMBO\src\pages\login' resolve '../../../angularfire2/auth' in 'D:\MakingChoices.be\MobileApps\Apps\OHA MBO\src\pages\login' using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.jso n (relative path: ./src/pages/login) Field 'browser' doesn't contain a valid alias configuration after using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\packa ge.json (relative path: ./src/pages/login) using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.j son (relative path: ./angularfire2/auth) no extension Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st .js Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts doesn't exist as directory D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] @ ./src/pages/login/login.ngfactory.js 39:0-55 @ ./src/app/app.module.ngfactory.js @ ./src/app/main.ts,./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve '../../angularfire2/auth' in 'D:\MakingCh oices.be\MobileApps\Apps\OHAMBO\src\app' resolve '../../angularfire2/auth' in 'D:\MakingChoices.be\MobileApps\Apps\OHAMBO \src\app' using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.jso n (relative path: ./src/app) Field 'browser' doesn't contain a valid alias configuration after using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\packa ge.json (relative path: ./src/app) using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.j son (relative path: ./angularfire2/auth) no extension Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st .js Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts doesn't exist as directory D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] @ ./src/app/app.module.ngfactory.js 32:0-52 @ ./src/app/main.ts,./src/app/app.component.ngfactory.js Module not found: Error: Can't resolve '../../angularfire2/auth' in 'D:\MakingCh oices.be\MobileApps\Apps\OHAMBO\src\app' resolve '../../angularfire2/auth' in 'D:\MakingChoices.be\MobileApps\Apps\OHAMBO \src\app' using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.jso n (relative path: ./src/app) Field 'browser' doesn't contain a valid alias configuration after using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\packa ge.json (relative path: ./src/app) using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.j son (relative path: ./angularfire2/auth) no extension Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st .js Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts doesn't exist as directory D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth doesn't exi st [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.js] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth.ts] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\auth] @ ./src/app/app.component.ngfactory.js 25:0-52 @ ./src/app/app.module.ngfactory.js @ ./src/app/main.ts,./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve '../../angularfire2/database' in 'D:\Maki ngChoices.be\MobileApps\Apps\OHAMBO\src\app' resolve '../../angularfire2/database' in 'D:\MakingChoices.be\MobileApps\Apps\OH AMBO\src\app' using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.jso n (relative path: ./src/app) Field 'browser' doesn't contain a valid alias configuration after using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\packa ge.json (relative path: ./src/app) using description file: D:\MakingChoices.be\MobileApps\Apps\OHAMBO\package.j son (relative path: ./angularfire2/database) no extension Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database doesn't exist .js Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database.js does n't exist .ts Field 'browser' doesn't contain a valid alias configuration D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database.ts does n't exist as directory D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database doesn't exist [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database.js] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database.ts] [D:\MakingChoices.be\MobileApps\Apps\OHAMBO\angularfire2\database] @ ./src/app/app.module.ngfactory.js 31:0-56 @ ./src/app/main.ts ** Errors in the JavaScript console **
** Output from firebase.database().enableLogging(true); **
** Screenshots **
Expected behavior
A good production build.
Actual behavior
Production build fails
I am facing same issue. @davideast Did you have any solution?
Same problem here..
This was a bug in version differences between the Angular CLI and Ionic CLI. Should be fixed in a day or so.
Is this updated yet?
Same issue here, wondering if an update is available!
Any update for this?. I hope use the next version!!.
I tested [email protected] [email protected] [email protected]
and build --prod fails in any version CMD: ionic cordova build android --prod
ionic version 3.12.0 node -v v8.3.0 npm -v5.4.2 cordova -v 7.0.1
@chris-eduardo I had the same problem until I installed @ ionic/app-scripts@nightly (and updated angular to 4.4.3 this is not necessarily). After this I manage to build with --prod flag. Good luck :)
PS. I'm still running [email protected]
My build is working with the --prod flag and [email protected] after installing ionic-angular@nightly and @ionic/app-scripts@nightly
is it wise to be using nightly builds?
On 27 September 2017 at 07:37, Brian Soumakian [email protected] wrote:
My build is working with the --prod flag and [email protected] after installing ionic-angular@nightly and @ionic/app-scripts@nightly
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angularfire2/issues/1124#issuecomment-332414071, or mute the thread https://github.com/notifications/unsubscribe-auth/ADMeUMzHmpq_lKl_8W30_OmCKBfqfWoQks5smd8TgaJpZM4PBwN- .
-- Ross Rawlins Tel: 021 531 7087 Cell: 072 424 9480 Skype: ross.rawlins Email: [email protected]
http://www.duovili.co.za https://plus.google.com/113781084234234096576/posts https://www.facebook.com/Duovili http://www.linkedin.com/company/duovili/ https://twitter.com/Duovili
This e-mail message and all attachments contain the CONFIDENTIAL AND PROPRIETARY information of DUOVILI DEVELOPMENTS. and may contain LEGALLY PRIVILEGED information. If you are not the intended recipient, you are hereby notified that any disclosure, distribution, or use of this e-mail, its attachments or any information contained therein is unauthorised and prohibited. If you have received this in error, please contact the sender immediately and delete this e-mail and any attachments.
@Ross-Rawlins not for your production environment, but it does indicate that this issue should be resolved with the next release of those two libraries
I would rather wait then as mine is in production already
Step 1: DELETE node_modules FOLDER
Step 2: in package.json delete angularfire2 in dependencies, after that: npm install
Step 3: npm install --save [email protected]
Step 4: ionic cordova build android --prod
that works for me, see ya !
This is a problem with the Ionic CLI. They should have it updated soon.
I'm having the same problem with 5.0.0-rc.2
@davideast Can you link the issue relating to this in the ionic CLI please?
@Abrahamh08 same issue in my ionic3 app with 5.0.0-rc.2. did you get any solution ??
@San10694 Yep, just build through XCode
Thank you @EduardoLZ That's work for me.
npm install --save [email protected] ionic cordova build android --prod --release
build successfully