angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Ionic production build fails.

Open petver opened this issue 9 years ago • 59 comments

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

petver avatar Aug 24 '17 18:08 petver

I am facing same issue. @davideast Did you have any solution?

prashanteb avatar Sep 13 '17 16:09 prashanteb

Same problem here..

silverio avatar Sep 14 '17 03:09 silverio

I downgraded to npm i --save [email protected]

and works now.

gocha-gochitashvili avatar Sep 14 '17 08:09 gocha-gochitashvili

This was a bug in version differences between the Angular CLI and Ionic CLI. Should be fixed in a day or so.

davideast avatar Sep 14 '17 17:09 davideast

Is this updated yet?

Ross-Rawlins avatar Sep 19 '17 08:09 Ross-Rawlins

Same issue here, wondering if an update is available!

josiekiwanuka avatar Sep 24 '17 02:09 josiekiwanuka

Any update for this?. I hope use the next version!!.

Nexeuz avatar Sep 26 '17 06:09 Nexeuz

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 avatar Sep 26 '17 18:09 chris-eduardo

@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]

cmartin81 avatar Sep 26 '17 19:09 cmartin81

My build is working with the --prod flag and [email protected] after installing ionic-angular@nightly and @ionic/app-scripts@nightly

soumak77 avatar Sep 27 '17 05:09 soumak77

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 avatar Sep 27 '17 07:09 Ross-Rawlins

@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

soumak77 avatar Sep 27 '17 07:09 soumak77

I would rather wait then as mine is in production already

Ross-Rawlins avatar Sep 27 '17 08:09 Ross-Rawlins

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 !

EduardoLZ avatar Oct 02 '17 06:10 EduardoLZ

This is a problem with the Ionic CLI. They should have it updated soon.

davideast avatar Oct 03 '17 19:10 davideast

I'm having the same problem with 5.0.0-rc.2

a6b6f64a avatar Oct 09 '17 06:10 a6b6f64a

@davideast Can you link the issue relating to this in the ionic CLI please?

a6b6f64a avatar Oct 10 '17 01:10 a6b6f64a

@Abrahamh08 same issue in my ionic3 app with 5.0.0-rc.2. did you get any solution ??

San10694 avatar Oct 13 '17 10:10 San10694

@San10694 Yep, just build through XCode

a6b6f64a avatar Oct 13 '17 13:10 a6b6f64a

Thank you @EduardoLZ That's work for me.

npm install --save [email protected] ionic cordova build android --prod --release

build successfully

prashanteb avatar Oct 16 '17 14:10 prashanteb