Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Module not found: Error: Can't resolve 'promise-polyfill' #1001

Open
gigocabrera opened this issue May 21, 2017 · 43 comments
Open

Module not found: Error: Can't resolve 'promise-polyfill' #1001

gigocabrera opened this issue May 21, 2017 · 43 comments

Comments

@gigocabrera
Copy link

Short description of the problem:

I'm seeing a weird behavior. When I run ionic serve my app builds and runs as expected. No issues. HOWEVER, when I run ionic upload to test the app in ionic view I get the error message below.

I KNOW it's a firebase error BUT why does it work fine using ionic serve and not with ionic upload?

What behavior are you expecting?

If running ionic serve works without any errors, I expect ionic upload to work as well.

Steps to reproduce:

Not sure how to reproduce this issue. Best if you visit my repo

  1. CajaFuerte
Running app-scripts build:

[20:57:28]  build dev started ...
[20:57:29]  clean started ...
[20:57:29]  clean finished in 7 ms
[20:57:29]  copy started ...
[20:57:29]  transpile started ...
[20:57:32]  transpile finished in 3.52 s
[20:57:32]  preprocess started ...
[20:57:32]  deeplinks started ...
[20:57:32]  deeplinks finished in 89 ms
[20:57:32]  preprocess finished in 91 ms
[20:57:32]  webpack started ...
[20:57:32]  copy finished in 3.86 s
Error: ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in 'C:\ionic\CajaFuerte-app\node_modules\firebase\app'
resolve 'promise-polyfill' in 'C:\ionic\CajaFuerte-app\node_modules\firebase\app'
  Parsed request is a module
  using description file: C:\ionic\CajaFuerte-app\node_modules\firebase\package.json (relative path: ./app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\ionic\CajaFuerte-app\node_modules\firebase\package.json (relative path: ./app)
    resolve as module
      looking for modules in C:\ionic\CajaFuerte-app\node_modules
        using description file: C:\ionic\CajaFuerte-app\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: C:\ionic\CajaFuerte-app\package.json (relative path: ./node_modules)
          using description file: C:\ionic\CajaFuerte-app\package.json (relative path: ./node_modules/promise-polyfill)
            as directory
              C:\ionic\CajaFuerte-app\node_modules\promise-polyfill doesn't exist
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\ionic\CajaFuerte-app\node_modules\promise-polyfill doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.json doesn't exist
[C:\ionic\CajaFuerte-app\node_modules\promise-polyfill]
[C:\ionic\CajaFuerte-app\node_modules\promise-polyfill]
[C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.ts]
[C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.js]
[C:\ionic\CajaFuerte-app\node_modules\promise-polyfill.json]
 @ ./~/firebase/app/shared_promise.js 37:35-62
 @ ./~/firebase/app/firebase_app.js
 @ ./~/firebase/app.js
 @ ./~/firebase/firebase-browser.js
 @ ./src/providers/auth-service.ts
 @ ./src/app/app.module.ts
 @ ./src/app/main.ts

Which @ionic/app-scripts version are you using?

PS C:\ionic\CajaFuerte-app> ionic info

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 6.5.0
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.9.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

@mcorrigan
Copy link

Had the same issue, this solved it:

npm install promise-polyfill --save-exact

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

@gigocabrera
Copy link
Author

@mcorrigan that did it. Thank you very much!!!

@percipio
Copy link

Woot! This worked for me also.

@joladubu
Copy link

working ... working .... worked for me!!!... gracias @mcorrigan

@HommyDeJ
Copy link

HommyDeJ commented Jun 4, 2017

Hello I did that and now I'm having another problem.

ionic cordova run android
Running app-scripts build: --address 0.0.0.0 --port 8100 --p 8100 --livereload-port 35729 --r 35729 --iscordovaserve --
externalIpRequired --nobrowser

[16:01:36] build dev started ...
[16:01:36] clean started ...
[16:01:36] clean finished in 3 ms
[16:01:36] copy started ...
[16:01:36] transpile started ...
[16:01:41] transpile finished in 5.00 s
[16:01:41] preprocess started ...
[16:01:41] deeplinks started ...
[16:01:42] deeplinks finished in 23 ms
W
[16:01:42] preprocess finished in 25 ms
[16:01:42] webpack started ...
[16:01:42] copy finished in 5.31 s
[16:02:06] webpack finished in 24.50 s
[16:02:06] sass started ...
[16:02:09] sass finished in 2.55 s
[16:02:09] postprocess started ...
[16:02:09] postprocess finished in 10 ms
[16:02:09] lint started ...
[16:02:09] build dev finished in 32.22 s

cordova run android
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.

[ERROR] Cordova encountered an error.
You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova run android (exit code 1).

hommydejesus@Hommy-PC:~/DenunciasApp$ (node:12726) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): Error [ERR_IPC_CHANNEL_CLOSED]: channel closed
(node:12726) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejectio
ns that are not handled will terminate the Node.js process with a non-zero exit code.

@fayeyen
Copy link

fayeyen commented Jun 13, 2017

thanks @mcorrigan

@MykalMachon
Copy link

@HommyDeJ I got this same error. Do you have the android development environment properly set up? the fastest way to do this is to install Android developer Studio.

@gigocabrera gigocabrera reopened this Jun 23, 2017
@gigocabrera
Copy link
Author

I got the same issue after updating to the latest ionic. Running the command below fixed it again

npm install promise-polyfill --save-exact

But do I have to run this command for every ionic update?

Which version are you using?

PS C:\ionic\CajaFuerte-app> ionic info

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : ios 4.3.1
Ionic Framework                 : ionic-angular 3.4.2

System:

Node       : v7.9.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 3.10.8

@jiteshkaranjkar
Copy link

Worked for me Thanks @mcorrigan

@janpio
Copy link

janpio commented Jun 28, 2017

Someone should open an issue with the package causing this problem, that this package gets added to their package.json.

@BraxAttack
Copy link

@mcorrigan you are a beautiful person!

@youstartlabs
Copy link

Bro You Make My day

@gkiran1
Copy link

gkiran1 commented Jul 6, 2017

Awesome... @mcorrigan

@boraikizoglu
Copy link

@mcorrigan This worked for me. Thanks

@david95thinkcode
Copy link

@mcorrigan Thanks. Worked for me

@kev-phillips
Copy link

Great. Put me in the fan of @mcorrigan camp 👍

@ChristianVega5421
Copy link

wooooow yes, working working, thanks so much

@bharathkumarms
Copy link

Oh Great!

@faridhajnal
Copy link

Life Saver ! Thanks a lot !

@mayoljonathan
Copy link

Thanks !

@ruchiy48
Copy link

hey, @mcorrigan thanks a lot! Worked for me..

@talcual
Copy link

talcual commented Aug 2, 2017

that's great, worked for me

@QUINNYELIZ
Copy link

@mcorrigan Thanks a lot it worked for me.

@bunday
Copy link

bunday commented Aug 8, 2017

awesome! thank you for this solution

@MichaelHuy
Copy link

MichaelHuy commented Aug 22, 2017

Not working with: --prod, ionic cordova build android --prod.
Fine with : ionic cordova build android

@MichaelHuy
Copy link

Still error with latest ionic cli 3.9.2
Work fine without --prod. I think there is problem with --prod build.
Here is log from my console
Error: ./src/app/app.module.ngfactory.js Module not found: Error: Can't resolve '../../angularfire2/auth' in '/Users/huyle/Upwork/HuyLe/moneyTrackerApp/src/app' resolve '../../angularfire2/auth' in '/Users/huyle/Upwork/HuyLe/moneyTrackerApp/src/app' using description file: /Users/huyle/Upwork/HuyLe/moneyTrackerApp/package.json (relative path: ./src/app) Field 'browser' doesn't contain a valid alias configuration after using description file: /Users/huyle/Upwork/HuyLe/moneyTrackerApp/package.json (relative path: ./src/app) using description file: /Users/huyle/Upwork/HuyLe/moneyTrackerApp/package.json (relative path: ./angularfire2/auth) no extension Field 'browser' doesn't contain a valid alias configuration /Users/huyle/Upwork/HuyLe/moneyTrackerApp/angularfire2/auth doesn't exist .js Field 'browser' doesn't contain a valid alias configuration /Users/huyle/Upwork/HuyLe/moneyTrackerApp/angularfire2/auth.js doesn't exist .ts Field 'browser' doesn't contain a valid alias configuration /Users/huyle/Upwork/HuyLe/moneyTrackerApp/angularfire2/auth.ts doesn't exist as directory /Users/huyle/Upwork/HuyLe/moneyTrackerApp/angularfire2/auth doesn't exist

@drashtimachchar
Copy link

npm install promise-polyfill --save-exact
I did it and It's working for me
@mcorrigan Thanks!

@razvantomegea
Copy link

razvantomegea commented Sep 2, 2017

@mcorrigan Worked magically! 👍

@matheus-fatguys
Copy link

npm install promise-polyfill --save-exact

Great! I think it saved me much time! Thank you

danielsogl added a commit to danielsogl/angularfire2 that referenced this issue Sep 5, 2017
davideast pushed a commit to angular/angularfire that referenced this issue Sep 6, 2017
@GURUcle
Copy link

GURUcle commented Sep 6, 2017

thnx bro

@itscodezero
Copy link

@mcorrigan worked for me as well. Thanks!

alltej added a commit to alltej/i3-fb-image-capture that referenced this issue Sep 12, 2017
@gopigopi096
Copy link

@mcorrigan super it worked for me

@joladubu
Copy link

thank you @gigocabrera and @mcorrigan . Worked fine. thumbs up

@RodibelMorales
Copy link

i have the same problem, it worked for me. thanks

@ss34nirala34
Copy link

@mcorrigan: Thank you so much.
I was facing same issue. After running the command below fixed it.
npm install promise-polyfill --save-exact.

First time failed, but again I tried running same command and worked perfectly.

Q: After running this command a file is created package-lock.json, what is this?

@Tommertom
Copy link

Tommertom commented Sep 24, 2017

Hi, while the npm install promise-polyfill --save-exact helps with me as well, the upload to Ionic Pro creates a build fail with the same error.

EDIT: fixed issue by adding "promise-polyfill":"6.0.2" to package.json

`
Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
on IonicJS Snapshot Runner (6c67ff43)
Using Shell executor...
Running on ip-10-2-119-255...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/6c67ff43/0/project-1'...
Checking out ab06ea2b as master...
Skipping Git submodules setup
$ fetch-updates
Checking for build process updates...
$ build-app
Fetching build dependencies...
Running: npm install
npm WARN deprecated babili@0.1.2: babili has been renamed to babel-minify. Please update to babel-minify
npm WARN deprecated babel-preset-babili@0.1.4: babili has been renamed to babel-minify. Please update to babel-preset-minify
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys

node-sass@4.5.3 install /usr/src/app/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-57_binding.node
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/gitlab-runner/.npm/node-sass/4.5.3/linux-x64-57_binding.node

uglifyjs-webpack-plugin@0.4.6 postinstall /usr/src/app/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

node-sass@4.5.3 postinstall /usr/src/app/node_modules/node-sass
node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 800 packages in 69.033s
npm install succeeded
Running: npm run build
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle agriscoor@0.0.1prebuild: agriscoor@0.0.1
npm info lifecycle agriscoor@0.0.1
build: agriscoor@0.0.1

agriscoor@0.0.1 build /usr/src/app
ionic-app-scripts build

[18:40:33] ionic-app-scripts 2.1.4
[18:40:33] build dev started ...
[18:40:33] clean started ...
[18:40:33] clean finished in 1 ms
[18:40:33] copy started ...
[18:40:33] transpile started ...
[18:40:38] transpile finished in 4.93 s
[18:40:38] preprocess started ...
[18:40:38] deeplinks started ...
[18:40:38] deeplinks finished in 129 ms
[18:40:38] preprocess finished in 131 ms
[18:40:38] webpack started ...
[18:40:39] copy finished in 5.36 s
[18:40:54] ionic-app-script task: "build"
[18:40:54] Error: ./node_modules/firebase/utils/promise.js Module not found: Error: Can't resolve 'promise-polyfill' in
'/usr/src/app/node_modules/firebase/utils' resolve 'promise-polyfill' in
'/usr/src/app/node_modules/firebase/utils' Parsed request is a module using description file:
/usr/src/app/node_modules/firebase/package.json (relative path: ./utils) Field 'browser' doesn't contain a
valid alias configuration after using description file: /usr/src/app/node_modules/firebase/package.json
(relative path: ./utils) resolve as module looking for modules in /usr/src/app/node_modules using
description file: /usr/src/app/package.json (relative path: ./node_modules) Field 'browser' doesn't contain
a valid alias configuration after using description file: /usr/src/app/package.json (relative path:
./node_modules) using description file: /usr/src/app/package.json (relative path:
./node_modules/promise-polyfill) no extension Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/promise-polyfill doesn't exist .ts Field 'browser' doesn't contain a valid alias
configuration /usr/src/app/node_modules/promise-polyfill.ts doesn't exist .js Field 'browser' doesn't
contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.js doesn't exist .json Field
'browser' doesn't contain a valid alias configuration /usr/src/app/node_modules/promise-polyfill.json
doesn't exist as directory /usr/src/app/node_modules/promise-polyfill doesn't exist
[/usr/src/app/node_modules/promise-polyfill] [/usr/src/app/node_modules/promise-polyfill.ts]
[/usr/src/app/node_modules/promise-polyfill.js] [/usr/src/app/node_modules/promise-polyfill.json]
[/usr/src/app/node_modules/promise-polyfill] @ ./node_modules/firebase/utils/promise.js 14:76-103 @
./node_modules/firebase/app/firebase_app.js @ ./node_modules/firebase/app.js @
./node_modules/angularfire2/firebase.app.module.js @ ./node_modules/angularfire2/index.js @
./src/app/app.module.ts @ ./src/app/main.ts
Error: ./node_modules/firebase/utils/promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in '/usr/src/app/node_modules/firebase/utils'
resolve 'promise-polyfill' in '/usr/src/app/node_modules/firebase/utils'
Parsed request is a module
using description file: /usr/src/app/node_modules/firebase/package.json (relative path: ./utils)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /usr/src/app/node_modules/firebase/package.json (relative path: ./utils)
resolve as module
looking for modules in /usr/src/app/node_modules
using description file: /usr/src/app/package.json (relative path: ./node_modules)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /usr/src/app/package.json (relative path: ./node_modules)
using description file: /usr/src/app/package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/promise-polyfill doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/promise-polyfill.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/promise-polyfill.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
/usr/src/app/node_modules/promise-polyfill.json doesn't exist
as directory
/usr/src/app/node_modules/promise-polyfill doesn't exist
[/usr/src/app/node_modules/promise-polyfill]
[/usr/src/app/node_modules/promise-polyfill.ts]
[/usr/src/app/node_modules/promise-polyfill.js]
[/usr/src/app/node_modules/promise-polyfill.json]
[/usr/src/app/node_modules/promise-polyfill]
@ ./node_modules/firebase/utils/promise.js 14:76-103
@ ./node_modules/firebase/app/firebase_app.js
@ ./node_modules/firebase/app.js
@ ./node_modules/angularfire2/firebase.app.module.js
@ ./node_modules/angularfire2/index.js
@ ./src/app/app.module.ts
@ ./src/app/main.ts
at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at callback (/usr/src/app/node_modules/@ionic/app-scripts/dist/webpack.js:119:28)
at emitRecords.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:269:13)
at Compiler.emitRecords (/usr/src/app/node_modules/webpack/lib/Compiler.js:375:38)
at emitAssets.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:368:12)
at next (/usr/src/app/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/usr/src/app/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/usr/src/app/node_modules/tapable/lib/Tapable.js:222:13)
at Compiler.afterEmit (/usr/src/app/node_modules/webpack/lib/Compiler.js:365:9)
npm info lifecycle agriscoor@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! agriscoor@0.0.1 build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the agriscoor@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/gitlab-runner/.npm/_logs/2017-09-24T18_40_54_728Z-debug.log
/snapshot.sh: line 32: [: missing ]' npm run build failed Make sure your project has a build script in the package.json Failed to upload build to storage please retry your build. Running after script... $ clean-up Cleaning up files... Successful clean up ERROR: Job failed: exit status 1

@apatnaik93
Copy link

Worked for me Thanks @mcorrigan.

@rizwanpolice
Copy link

Yes that woked for me thanks.

@medialnk
Copy link

@mcorrigan thanks! That solved the problem for me as well and now I can successfully build ios again.

@franzisk
Copy link

Nothing seems to work for me, getting:

Error: ./src/app/app.module.ngfactory.ts
Module not found: Error: Can't resolve '../../angularfire2/auth' in '/Users/francisco/Projetos-Ionic/Jungery/src/app'
resolve '../../angularfire2/auth' in '/Users/francisco/Projetos-Ionic/Jungery/src/app'
  using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./src/app)
    using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./angularfire2/auth)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.json doesn't exist
      as directory
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth doesn't exist
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.ts]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.js]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth.json]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/auth]
 @ ./src/app/app.module.ngfactory.ts 28:0-51
 @ ./src/app/main.ts,./src/app/app.module.ngfactory.ts
Module not found: Error: Can't resolve '../../angularfire2/database' in '/Users/francisco/Projetos-Ionic/Jungery/src/app'
resolve '../../angularfire2/database' in '/Users/francisco/Projetos-Ionic/Jungery/src/app'
  using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./src/app)
    using description file: /Users/francisco/Projetos-Ionic/Jungery/package.json (relative path: ./angularfire2/database)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/database doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.json doesn't exist
      as directory
        /Users/francisco/Projetos-Ionic/Jungery/angularfire2/database doesn't exist
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/database]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.ts]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.js]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/database.json]
[/Users/francisco/Projetos-Ionic/Jungery/angularfire2/database]
 @ ./src/app/app.module.ngfactory.ts 27:0-55
 @ ./src/app/main.ts
    at new BuildError (/Users/francisco/Projetos-Ionic/Jungery/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/Users/francisco/Projetos-Ionic/Jungery/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/francisco/Projetos-Ionic/Jungery/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/francisco/Projetos-Ionic/Jungery/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/francisco/Projetos-Ionic/Jungery/node_modules/webpack/lib/Compiler.js:365:9)

My environment:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 6.5.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 6.3.0 ios 4.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.1
    ios-sim    : 5.0.12
    Node       : v7.0.0
    npm        : 5.3.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b

The error above occurs still after running:
% npm install promise-polyfill --save-exact

Any other clue?

@kehkashan22
Copy link

@franzisk same here, i have trying to get my app out there, but ionic just wont build with the --prod flag. Any resolutions to this issue yet?

@franzisk
Copy link

I am sorry @kehkashan22 but I don't remember how I solved this, but I can show you my list of plugins and the version of everything, I think that something you must check is all plugin version (update them), the cordova version used on the project and the platform version.

Here are meine:
Cordova plugins (% cordova plugin list):

com.googlemaps.ios 2.5.0 "Google Maps SDK for iOS"
com.telerik.plugins.nativepagetransitions 0.6.5 "Native Page Transitions"
cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
cordova-plugin-android-permissions 1.0.0 "Permissions"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-crosswalk-webview 2.4.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-geolocation 2.4.3 "Geolocation"
cordova-plugin-googleplus 5.2.3 "Google SignIn"
cordova-plugin-linkedin 1.2.1 "LinkedIn"
cordova-plugin-mauron85-background-geolocation 2.3.2 "CDVBackgroundGeolocation"
cordova-plugin-nativegeocoder 2.0.4 "NativeGeocoder"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-swift-support 3.1.1 "SwiftSupport"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 0.7.14 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-barcodescanner 7.0.1 "BarcodeScanner"
phonegap-plugin-push 2.1.2 "PushPlugin"
twitter-connect-plugin 0.6.0 "Twitter Connect"

Ionic Info:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.9
    Cordova Platforms  : android 6.3.0 browser 5.0.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    ios-deploy : 1.9.1
    Node       : v7.0.0
    npm        : 5.3.0
    OS         : macOS High Sierra
    Xcode      : Xcode 9.3.1 Build version 9E501

Also, try just a:
% sudo cordova compile android

@ikishanoza
Copy link

I have similar issue can anyone help please ?
I have describe here on SO: https://stackoverflow.com/questions/58645655/cannot-find-module-promise-polyfill-lib-polyfill

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests