Angular: 4.1.3
Firebase: 4.1.1
AngularFire: 4.0.0.rc.1
Other (e.g. Ionic/Cordova, Node, browser, operating system):
npm 4.6.1 and npm 5.0.2
Chrome 58
Windows 10 - Creator update
Steps to set up and reproduce
Simple upgraded my working project from 4.0.0.rc.0, to 4.0.0.rc.1 , downgrade solved the issue.
I'm using this starter: https://github.com/AngularClass/angular-starter (latest update)
You can install angularfire2 and firebase, do imports.
I have cleared node_modules folder, was not helpful.
** Errors in the JavaScript console **
client:119 ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in 'D:\Sources\HeroMobileAngular\node_modules\firebase\app'
@ ./~/firebase/app/shared_promise.js 37:35-62
@ ./~/firebase/app/firebase_app.js
@ ./~/firebase/app.js
@ ./~/firebase/firebase-browser.js
@ ./src/providers/user-auth-service/user-auth.service.ts
@ ./src/app/app.module.ts
@ ./src/app/index.ts
@ ./src/main.browser.ts
@ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/main.browser.ts
errors @ client:119
sock.onmessage @ socket.js:37
EventTarget.dispatchEvent @ eventtarget.js:51
(anonymous) @ main.js:274
SockJS._transportMessage @ main.js:272
EventEmitter.emit @ emitter.js:50
WebSocketTransport.ws.onmessage @ websocket.js:35
wrapFn @ zone.js:1055
ZoneDelegate.invokeTask @ zone.js:424
Zone.runTask @ zone.js:191
ZoneTask.invoke @ zone.js:486
I got the same thing after installing latest 4.1.1
it is the same issue with Firebase 4.0.0, sound like it is missing promise-polyfill dependency.
Same with me too...
Error: ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in
Parsed request is a module
node_modules/promise-polyfill doesn't exist
no extension
Field 'browser' doesn't contain a valid alias configuration
@ ./~/firebase/app/shared_promise.js 37:35-62
@ ./~/firebase/app/firebase_app.js
@ ./~/firebase/app.js
@ ./~/firebase/firebase-browser.js
@ ./src/pages/home/home.ts
@ ./src/app/app.module.ts
@ ./src/app/main.ts
Ionic info:
global packages:
@ionic/cli-utils : 1.3.0
Cordova CLI : 7.0.1
Ionic CLI : 3.3.0
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.3.0
@ionic/cli-plugin-ionic-angular : 1.3.0
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.3.0
System:
Node : v6.10.1
OS : macOS Sierra
Xcode : Xcode 8.2.1 Build version 8C1002
ios-deploy : 1.8.6
ios-sim : 5.0.8
This is the fix that worked for me : npm install promise-polyfill --save-exact
This sounds like an issue with something upstream, as we just depend on firebase ^4.0.0, though I double checked and Firebase 4.1.1 has promise-polyfil as a dependency in it's package.json. Any ideas on why the dependency might have been dropped? I'm less familiar with Ionic than I should be TBH.
@jamesdaniels I'm using Angular for web not ionic, using this starter: https://github.com/AngularClass/angular-starter
Sounds like a bug with the starter then? I don't have any troubles with Angular CLI.
Actually the path for importing "promise-polyfill" dependency is given to original node_module folder.. so instead of manually editing it and creating chances of messing up other things, its better to install promise-polyfill through npm.. like how Mr.ghost has mentioned above.
Should be fixed in the latest Firebase SDK release.
firebase 4.3.0 doesn't fix the problem.
If you use Ionic Framework the online compile doesn't work and you can't "npm install promise-polyfill" there.
Similar to @smark91, in my Ionic project I could run locally just fine (ionic serve) but the ionic upload command to build and upload to their cloud services failed with this same issue:
Error: ./node_modules/firebase/utils/promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in '/Users/david/Projects/my-app/node_modules/firebase/utils'
My relevant dependencies:
"angularfire2": "^4.0.0-rc.2",
"firebase": "^4.3.0",
Please advise if this seems like a new issue, an issue for Ionic team, or other.
See also https://github.com/angular/angularfire2/issues/1055
Which was closed, but it seems to me like the promise-polyfill dep should be automagically handled by the parent dep.
As other issue demontrate the solution is: npm install promise-polyfill --save-exact.
Unfortunatly Ionic Dashboard doesn't allow to execute arbitrary command.
Seems that the problem is related to firebase module. We need to open probably a issue in their repo.
I am having the same issue. Very frustrating. No problems locally, only with building on ionic
I am having the same issue as @smark91 and @DavidFrahm. The project is running perfectly locally, however it is not running on uploading the project. Is there any update here?
@smark91, @NickKirschke, @benjanisa current solution (I came up with it once reading this issue) would be to run npm install promise-polyfill --save (note that it is not the same as --save-exact which doesn't modify package.json itself, only the node_modules). This way Ionic build will install everything from package.json including the promise-polyfill.
@MaciejCaputa That worked! Thank you for your help!
Worked perfectly, thanks @MaciejCaputa
Most helpful comment
This is the fix that worked for me : npm install promise-polyfill --save-exact