angularfire: rc.1: Module not found: Error: Can't resolve 'promise-polyfill'

Version info

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

How to reproduce these conditions

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.

Debug output

** 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

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 18 (5 by maintainers)

Most upvoted comments

This is the fix that worked for me : npm install promise-polyfill --save-exact

@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.

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.

@MaciejCaputa That worked! Thank you for your help!