Ionic 3.9.2 incompatible with AngularFire2

When running ionic cordova build android, my app builds and runs on my android device. However, when building a production build using “ionic cordova build android --prod”, I get the following error (only with latest ionic update)

Error: ./src/pages/login/login.ngfactory.js
Module not found: Error: Can’t resolve ‘…/…/…/angularfire2/auth’ in 'C:\edu\src\pages\login’
resolve ‘…/…/…/angularfire2/auth’ in 'C:\edu\src\pages\login’
using description file: C:\edu\package.json (relative path: ./src/pages/login)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: C:\edu\package.json (relative path: ./src/pages/login)
using description file: C:\edu\package.json (relative path: ./angularfire2/auth)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
C:\edu\angularfire2\auth doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
C:\edu\angularfire2\auth.js doesn’t exist
.ts
Field ‘browser’ doesn’t contain a valid alias configuration
C:\edu\angularfire2\auth.ts doesn’t exist
as directory
C:\edu\angularfire2\auth doesn’t exist
[C:\edu\angularfire2\auth]
[C:\edu\angularfire2\auth.js]
[C:\edu\angularfire2\auth.ts]
[C:\edu\angularfire2\auth]
@ ./src/pages/login/login.ngfactory.js 43:0-55
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./src/pages/login/login.ngfactory.js

1 Like

I faced with this issues.
Not working: ionic cordova build android --prod -release
Working fine without --prod.
Any advices to fix this issue?

What do you mean ionic 3.9.2 ? there latest stable version of ionic is 3.6.0

Hi, I managed to fix this.
(3.9.2 was released 5 days ago)

I had to start a new project with Ionic 3.8.1 and moved my entire src folder (exluding src/app/main.ts, index.html, service-worker.js, manifest.json) to the new project. Works perfectly now.

Not really a fix and I don’t really understand the cause of the issue.

Ok, it is ionic-cli 3.9.2.

I solved it with npm i --save angularfire2@4.0.0-rc.1

4 Likes

it works for me. tq mate… is this problem is temporary or it will be fix in next update?