Firebase error in ionic 3.2.0 while building for android

when i give this command
ionic cordova build android --prod
i am getting this error.

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.
Error: ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in 'C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\firebase\app'
resolve 'promise-polyfill' in 'C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\firebase\app'
  Parsed request is a module
  using description file: C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\firebase\package.json (relative path: ./app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\firebase\package.json (relative path: ./app)
    resolve as module
      looking for modules in C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules
        using description file: C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\package.json (relative path: ./node_modules)
          using description file: C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\package.json (relative path: ./node_modules/promise-polyfill)
            as directory
              C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill doesn't exist
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.json doesn't exist
[C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill]
[C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill]
[C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.ts]
[C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.js]
[C:\Users\BhatRitesh\Desktop\Think-Digital\campusLink\node_modules\promise-polyfill.json]
 @ ./~/firebase/app/shared_promise.js 38:35-62
 @ ./~/firebase/app/firebase_app.js
 @ ./~/firebase/app.js
 @ ./src/pages/login/login.ts
 @ ./src/app/app.module.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts

Can anyone tell how to resolve this error.?

Hello, you can try it!

npm install promise-polyfill --save-exact

Source: http://stackoverflow.com/questions/43428415/error-in-firebase-app-shared-promise-js

7 Likes