--prod dont work - angularfire2

hello ionic team
after 3 week of searching. some time i resolve problem and some time it crash, so i try all solutions from stackoverflow to github
Exemples:
1- update(downgrade/upgrade) promise-pollyfil => before it work, but now not work
2- typescript (downgrade/upgrade)
3- @ionic/cli-plugin-cordova) (downgrade/upgrade)
4- reinstall (node_module)
5- try in other pc/laptop (yep, i did that in office :slight_smile: but boss didnt catch me :D)

and this ERROR :


Running app-scripts build: --build --prod --iscordovaserve --nobrowser

[22:50:12]  build prod started ...
[22:50:12]  clean started ...
[22:50:12]  clean finished in 35 ms
[22:50:12]  copy started ...
[22:50:12]  ngc started ...
[22:51:46]  ngc finished in 94.41 s
[22:51:46]  preprocess started ...
[22:51:46]  deeplinks started ...
[22:51:50]  deeplinks finished in 3.66 s
[22:51:50]  optimization started ...
[22:51:53]  copy finished in 101.11 s
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova).
Error: ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../angularfire2/auth' in 'D:\ws\wassafat\src\app'
resolve '../../angularfire2/auth' in 'D:\ws\wassafat\src\app'
  using description file: D:\ws\wassafat\package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: D:\ws\wassafat\package.json (relative path: ./src/app)
    using description file: D:\ws\wassafat\package.json (relative path: ./angularfire2/auth)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\auth doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\auth.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\auth.ts doesn't exist
      as directory
        D:\ws\wassafat\angularfire2\auth doesn't exist
[D:\ws\wassafat\angularfire2\auth]
[D:\ws\wassafat\angularfire2\auth.js]
[D:\ws\wassafat\angularfire2\auth.ts]
[D:\ws\wassafat\angularfire2\auth]
 @ ./src/app/app.module.ngfactory.js 30:0-52
 @ ./src/app/main.ts,./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '../../angularfire2/database' in 'D:\ws\wassafat\src\app'
resolve '../../angularfire2/database' in 'D:\ws\wassafat\src\app'
  using description file: D:\ws\wassafat\package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: D:\ws\wassafat\package.json (relative path: ./src/app)
    using description file: D:\ws\wassafat\package.json (relative path: ./angularfire2/database)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\database doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\database.js doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        D:\ws\wassafat\angularfire2\database.ts doesn't exist
      as directory
        D:\ws\wassafat\angularfire2\database doesn't exist
[D:\ws\wassafat\angularfire2\database]
[D:\ws\wassafat\angularfire2\database.js]
[D:\ws\wassafat\angularfire2\database.ts]
[D:\ws\wassafat\angularfire2\database]
 @ ./src/app/app.module.ngfactory.js 31:0-56
 @ ./src/app/main.ts

info :



cli packages: (D:\ws\wassafat\node_modules)

    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

global packages:

    Cordova CLI : 7.0.1

local packages:

    @ionic/app-scripts : 1.3.12
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.5.3

System:

    Node : v6.9.1
    OS   : Windows 10
    npm  : 3.10.8

Have you tried running npm install promise-polyfill --save-exact in the command line?

didn’t work i tried that before and now but it still the same

thank you for trying :slight_smile:

Bummer. Sorry tilmido

after serching like 3 week the solution is downgrade angularefire2 rc.2 to rc.1/rc.0

npm i angularfire2@4.0.0-rc.1

waaa :triumph::rage::face_with_symbols_over_mouth:


I had this problem on rc.1 and just tried to upgrade to latest hoping it would help.

edit:
It’s looking like maybe I wasn’t using rc.1 even though my package.json was requiring that version.
I rolled back with:

npm i --save angularfire2@4.0.0-rc.1

It then started complaining about being unable to resolve the promise-polyfill module. So I’m now just running

npm install promise-polyfill --save-exact

Hopefully that will allow me to build!

Any way you could find with angularfire2@5.0.0-rc-3 ? Really struggling to get through this… :frowning: