"ionic upload": getting an error

I’m trying to upload an app to Ionic View unsuccessfully.
Ionic link worked well but when i ran ionic upload I got an error.
My app is using firebase.
App is working fine on an emulator.

ionic info -

cli packages:

    @ionic/cli-plugin-ionic-angular : 1.4.0 (e:\Ionic\Conv_blank\node_modules\@ionic\cli-plugin-ionic-angular)
    @ionic/cli-utils                : 1.6.0 (e:\Ionic\Conv_blank\node_modules\@ionic\cli-utils)
    ionic (Ionic CLI)               : 3.6.0 (e:\Ionic\Conv_blank\node_modules\ionic)

local packages:

    @ionic/app-scripts : 2.1.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v6.11.1
    OS   : Windows 10
    npm  : 3.10.10

This is the output I’m getting -

Error: ./node_modules/firebase/utils/promise.js
Module not found: Error: Can’t resolve ‘promise-polyfill’ in 'e:\Ionic\Conv_blank\node_modules\firebase\utils’
resolve ‘promise-polyfill’ in 'e:\Ionic\Conv_blank\node_modules\firebase\utils’
Parsed request is a module
using description file: e:\Ionic\Conv_blank\node_modules\firebase\package.json (relative path: ./utils)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\node_modules\firebase\package.json (relative path: ./utils)
resolve as module
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.ts
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directory
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.ts
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directory
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.ts
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.js
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.json
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
Error: ./node_modules/firebase/utils/promise.js
Module not found: Error: Can’t resolve ‘promise-polyfill’ in 'e:\Ionic\Conv_blank\node_modules\firebase\utils’
resolve ‘promise-polyfill’ in 'e:\Ionic\Conv_blank\node_modules\firebase\utils’
Parsed request is a modulele: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\node_modules\firebase\package.json (relative path: ./utils)
Field ‘browser’ doesn’t contain a valid alias configurationge.json (relative path: ./node_modules)
after using description file: e:\Ionic\Conv_blank\node_modules\firebase\package.json (relative path: ./utils)ill)
resolve as moduleion
looking for modules in e:\Ionic\Conv_blank\node_modulesonfiguration
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t existist
.tson
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t existst
.jsdirectory
Field ‘browser’ doesn’t contain a valid alias configurationxist
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsoncription file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t existath: ./node_modules)
as directoryion file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modulesonfiguration
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t existist
.tson
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t existst
.jsdirectory
Field ‘browser’ doesn’t contain a valid alias configurationxist
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsoncription file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t existath: ./node_modules)
as directoryion file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modulesonfiguration
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extension
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t existist
.tson
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t existst
.jsdirectory
Field ‘browser’ doesn’t contain a valid alias configurationxist
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsonank\node_modules\promise-polyfill]
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directorye_modules\promise-polyfill]
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extensione_modules\promise-polyfill.ts]
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.tsblank\node_modules\promise-polyfill.js]
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.jsblank\node_modules\promise-polyfill.js]
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsonank\node_modules\promise-polyfill.json]
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directorye_modules\promise-polyfill.json]
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extensionse/utils/promise.js 14:76-103
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.tses/firebase/auth.js
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.jsp.module.ts
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsonnk>ionic link
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directoryd f8b07a46
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
looking for modules in e:\Ionic\Conv_blank\node_modules
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
Field ‘browser’ doesn’t contain a valid alias configuration
after using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules)
using description file: e:\Ionic\Conv_blank\package.json (relative path: ./node_modules/promise-polyfill)
no extensionarted …
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist
.tsy started …
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.ts doesn’t exist
.jsprocess started …
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.js doesn’t exist
.jsonocess finished in 57 ms
Field ‘browser’ doesn’t contain a valid alias configuration
e:\Ionic\Conv_blank\node_modules\promise-polyfill.json doesn’t exist
as directory
e:\Ionic\Conv_blank\node_modules\promise-polyfill doesn’t exist

Please edit your post, it is not very readable at the moment.
Use the </> button above the input field to format your code, command line output or error message (select the text first, then click the button or wrap it in ``` manually). Check the preview if it looks better. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

Post your ionic info output please.
Post the whole command your are running with all output it generates.

I have the sam issue.

Ionic serve runs without Problems.

ionic build

runs with the same error.

cli packages: (C:\Users\jackt\Documents\GitHub\robojackAdmin\node_modules)

    @ionic/cli-utils  : 1.9.0
    ionic (Ionic CLI) : 3.9.0

global packages:

    Cordova CLI : 6.5.0

local packages:

    @ionic/app-scripts : 1.3.7
    Cordova Platforms  : browser 4.1.0
    Ionic Framework    : ionic-angular 3.4.2

System:

    Node : v6.10.2
    npm  : 3.10.10
    OS   : Windows 10

Please post your complete error.

Yours has nothing to do with ionic upload or the Ionic View app?

gyjoules already postet the complete Output.

I found a solution that worked for me.

npm install promise-polyfill --save-exact

Solved it for local build.

To solve this for remote build (ionic pro) I add

"promise-polyfill": "^6.0.2"

to the package.json dependencies.

I’m baffled as to why promise-polyfill should be needed anywhere today.

It may not be, but a firebase.Promise isn’t the same as a regular Promise, so I’m willing to believe that it’s possible to create an issue. Firebase connects its promise to a Thenable interface. Casting to a standard Promise is usually fine in my experience, but maybe the OP is doing something special.

But (as I understand it) promise-polyfill is only needed if you are operating in a runtime environment that lacks proper Promises, which shouldn’t be true of anything an Ionic app is running in, or of any node environment that build tools are.

Maybe the Firebase code is old? I’ve looked at some of the AngularFire code, but never at the Firebase code. I’m not even sure how much is open source.

Judging from this, it would never come into play in a modern environment.

I don’t yet understand what I’m looking at, sorry. Should I infer that it’s required for build but never used?

It’s a search across the code base showing that the only place it would ever take effect is if there is no Promise in the global scope (which should never happen today), so it’s effectively an obsolete dependency.

1 Like

Hello rapopos,

i just installt firebase and do some auth with email database and store things. But it is just for learning. Next I try angularFire2.

Here is the error from the online build log, just for your Informaiton:

[20:04:54]  webpack started ... 
Error: ./~/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]
 @ ./~/firebase/utils/promise.js 10:76-103
 @ ./~/firebase/app/firebase_app.js
 @ ./~/firebase/app.js
 @ ./~/firebase/firebase-browser.js
 @ ./src/app/app.component.ts
 @ ./src/app/app.module.ngfactory.ts
 @ ./src/app/main.ts
ionic build failed...falling back to npm run build

Thanks for your support, and I hope I get you baffled in the future :wink:

@aaronsterling @rapropos The problem is not that the code actually needs it, but that webpack doesn’t know that it does not need it. It just sees the require and tries to get the code, which it can’t find as it isn’t installed (as it isn’t really needed).