Angular: 5.0
Firebase: 4.8.1
AngularFire: 5.0.0-rc.4
Other (e.g. Ionic/Cordova, Node, browser, operating system):
no
Steps to set up and reproduce
Follow the Installation & Setup guide in the agunlarfire 2 github
Sample data and security rules
<-- include/attach/link to some json sample data (or provide credentials to a sanitized, test Firebase project) -->
* Errors in the JavaScript console *
* Output from firebase.database().enableLogging(true); *
* Screenshots *
ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/auth/auth.d.ts(11,36): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(5,45): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(8,17): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(9,21): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(11,20): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(13,22): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(8,43): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(9,46): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(9,80): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(10,49): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(10,95): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(10,140): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(10,182): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(11,49): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(11,94): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/changes.d.ts(11,130): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(8,54): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(8,96): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(10,19): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(12,22): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(12,69): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(13,27): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(14,25): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(15,30): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(16,27): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/collection/collection.d.ts(17,27): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/document/document.d.ts(8,10): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/document/document.d.ts(9,22): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/document/document.d.ts(10,28): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/document/document.d.ts(14,42): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/firestore.d.ts(9,55): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/firestore.d.ts(12,25): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(4,11): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(5,14): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(14,37): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(14,80): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(16,10): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/interfaces.d.ts(17,12): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(6,41): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(6,80): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(7,41): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(7,98): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(8,48): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firestore/observable/fromRef.d.ts(8,93): error TS2503: Cannot find namespace 'firebase'.
Project compiles successfully
The project doesn't compile
I started getting this error last night as well out of the blue. I even reran builds that has just completed successfully that then failed with no changes.
I think this new error may be related to the firebase refactoring specified in the latest comments in angular/angularfire2#1385
There is a PR open for this issue. https://github.com/angular/angularfire2/pull/1386
@rts-cwalker The same happened to me.
Changing it to firebase 4.8.0 fixed the issue as stated in the other thread.
@a-cordoba10 You building locally? Bc I changed to 4.8.0 in my package.json file, but I cant change it in angularfire 2 dependencies when it builds on Travis CI.
Im building locally, but now im getting this error when building my auth service
ERROR in ../../../node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types/private'.
../../../node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app-types/private'.
@a-cordoba10 that is 4.8.1 catching ya https://github.com/firebase/firebase-js-sdk/issues/387#issuecomment-352633693
@myspivey How? In my package.json I have "angularfire2": "5.0.0-rc.4", and "firebase": "4.8.0", (I have also tried with "firebase": "4.7.0") and after npm install I still have the problem
Think AF2 is grabbing it and some fighting is going on. Try seeing what is inside AF2.
Well I at least figured out what i was doing wrong.... Forgot to remove the prefix that allowed patch versions to be installed. Thus it kept installing 4.8.1
@a-cordoba10 Make sure you dont have a leading ^ in front of the 4.8.0 in package.json for firebase. Also there is an angularfire2 v5.0.0-rc.5 available that may help. I made both of these changes and it works for me now
4.8.1 was a refactor of the typings and you now pull your imports from @firebase:
import { FirebaseApp } from '@firebase/app-types';
import { FirebaseAuth } from '@firebase/auth-types';
import { FirebaseDatabase } from '@firebase/database-types';
import { FirebaseMessaging } from '@firebase/messaging-types';
import { FirebaseStorage } from '@firebase/storage-types';
import { FirebaseFirestore } from '@firebase/firestore-types';
I found this, maybe we can make some update ?
@hiepxanh there is already a PR open to fix. #1386
@rts-cwalker thanks, I don't see that, Can't believe they release breaking change in xmas
Whats just as shocking is that its released as a "patch" release.. Breaking changes should AT LEAST be minor version release.
finally !!! i know the problem and could fix it with a downgrade to 4.8.0
Can we get a warning next before breaking changes come in....
Firebase really should have done this refactor this at a SemVer major point since it is going to break everyone's TypeScript builds. Instead they did it between 4.8.0 and 4.8.1.
I'm getting this same error right now, downgraded, upgraded, did everything but still didn't work.
I'm using:
"angularfire2": "^5.0.0-rc.4",
"firebase": "4.8.1",
I also upgraded to rc.5 but that didn't fix the error
My error log looks like so:
ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/auth/auth.d.ts(11,36): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(5,45): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(8,17): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(9,21): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(10,22): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(11,20): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/firebase.app.module.d.ts(13,22): error TS2503: Cannot find namespace 'firebase'.
When is a bug fix likely to be released?
mayordwells you need to downgrade Firebase to 4.8.0. That will resolve till a fix is out.
Downgrading to firebase 4.8.0 fixed it for me
@asgarli Thanks, I'll try to do the same.
this resolution doesnt work for me.
"dependencies": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@ionic-native/core": "4.4.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/pro": "1.0.16",
"@ionic/storage": "2.1.3",
"@types/firebase": "^2.4.32",
"angularfire2": "^5.0.0-rc.4",
"firebase": "4.8.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"promise-polyfill": "^6.1.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
}
@darlondjc can you verify what /node_modules/firebase/package.json reports as the version? Your setup looks fine.
@myspivey:
{
"_from": "[email protected]",
"_id": "[email protected]",
"_inBundle": false,
"_integrity": "xxx",
"_location": "/firebase",
"_phantomChildren": {
"@firebase/webchannel-wrapper": "0.2.5",
"faye-websocket": "0.11.1",
"grpc": "1.8.0"
},
"_requested": {
"type": "version",
"registry": true,
"raw": "[email protected]",
"name": "firebase",
"escapedName": "firebase",
"rawSpec": "4.8.0",
"saveSpec": null,
"fetchSpec": "4.8.0"
},
"_requiredBy": [
"/"
],
"_resolved": "https://registry.npmjs.org/firebase/-/firebase-4.8.0.tgz",
"_shasum": "c0b5bad5c1241222f3a6f06065ea121ebbc14fd3",
"_spec": "[email protected]",
"_where": "C:\workspace\loteca",
"author": {
"name": "Firebase",
"email": "[email protected]",
"url": "https://firebase.google.com/"
},
"browser": "index.js",
"bugs": {
"url": "https://github.com/firebase/firebase-js-sdk/issues"
},
"bundleDependencies": false,
"dependencies": {
"@firebase/app": "0.1.4",
"@firebase/auth": "0.3.0",
"@firebase/database": "0.1.5",
"@firebase/firestore": "0.2.1",
"@firebase/messaging": "0.1.5",
"@firebase/polyfill": "0.1.3",
"@firebase/storage": "0.1.4",
"dom-storage": "^2.0.2",
"xmlhttprequest": "^1.8.0"
},
"deprecated": false,
"description": "Firebase JavaScript library for web and Node.js",
"devDependencies": {
"compression-webpack-plugin": "^1.0.0",
"git-rev-sync": "^1.9.1",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-concat": "^2.6.1",
"gulp-sourcemaps": "^2.6.1",
"npm-run-all": "^4.1.1",
"webpack": "^3.5.6",
"webpack-dev-server": "^2.8.1",
"webpack-stream": "^4.0.0",
"wrapper-webpack-plugin": "^1.0.0"
},
"homepage": "https://firebase.google.com/",
"keywords": [
"authentication",
"database",
"Firebase",
"firebase",
"realtime",
"storage"
],
"license": "Apache-2.0",
"main": "index.node.js",
"name": "firebase",
"react-native": "index.react-native.js",
"repository": {
"type": "git",
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
},
"scripts": {
"dev": "run-p watch:compiler watch:server",
"prepare": "gulp build",
"watch:compiler": "gulp watch",
"watch:server": "webpack-dev-server --config webpack.dev.js --colors"
},
"typings": "index.d.ts",
"version": "4.8.0"
}
Upgrading angularfire2 and downgrading firebase fixed it for me.
"angularfire2": "5.0.0-rc.5", + "firebase": "4.8.0",
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"@angular/service-worker": "^5.0.0",
"@ngrx/store": "^4.1.1",
"angularfire2": "5.0.0-rc.5",
"core-js": "^2.4.1",
"firebase": "4.8.0",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
"angularfire2": "5.0.0-rc.5", and "firebase": "4.8.0" did not work yet. :(
"angularfire2": "5.0.0-rc.5", and "firebase": "4.8.0" did work for me :)
@darlondjc , did you ran _npm update_ on the root folder? I was missing that step
@cdosorio i did it right now (again), just for confirm, but stays the same error.
typescript error
Cannot find type definition file for 'firebase'.
I am having bad time with this error
did anyone got a fix?
"angularfire2": "^5.0.0-rc.5", and "firebase": "4.8.0" didn't work for me either.
Be sure on your package.json file that the firebase version doesn't have the ^ symbol, otherwise you will be importing version 4.8.1 not 4.8.0.:
"angularfire2": "^5.0.0-rc.5",
"firebase": "4.8.0",
The mine one's like this (and it doesnt work anway):
"angularfire2": "^5.0.0-rc.5",
"firebase": "4.8.0"
If I try [email protected] without the ^ I get:
No matching version found for [email protected]
Is only me?
Step1 -- Downgrade firebase to 4.8.0 and remove ^,
Step2-- Remove ^ from "angularfire2": "5.0.0-rc.4",
Step3-- run npm update and restart your VSCODE
"dependencies": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@firebase/firestore": "^0.2.2",
"@firebase/webchannel-wrapper": "0.2.5",
"@ionic-native/core": "4.4.0",
"@ionic-native/splash-screen": "^4.5.2",
"@ionic-native/status-bar": "4.4.0",
"@ionic/pro": "1.0.16",
"@ionic/storage": "2.1.3",
"angularfire2": "5.0.0-rc.4",
"cordova-android": "6.3.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "^4.1.0",
"cordova-plugin-whitelist": "^1.3.3",
"cordova-splashscreen": "^3.1.0",
"firebase": "4.8.0",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"promise-polyfill": "^6.1.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
Go back to firebase 4.8.0:
@hanihoumani93 Thank you. Had to remove ^ and it worked fine.
npm install [email protected]
Solution:
1. Inside package.json, remove ^ from "firebase": "^4.8.1"
1.1 Downgrade Firebase from 4.8.1 to 4.8.0 by changing 4.8.1 to 4.8.0
1.2 End result should look like this: "firebase": "4.8.0"
2. Run npm update in the Project Root. NPM will downgrade Firebase for ya
3. Run ng serve --open to check for compilation errors. There shouldn't be any.
4. Enjoy!
Reason:
Firebase had introduced some breaking changes that AngularFire2 had not coped up with yet. Until the AngularFire2 team work it out, this will be the solution.
Add a thumbs up emoji and direct anyone having the same trouble here! Would save a lot of their time!
"angularfire2": "^5.0.0-rc.5",
"firebase": "4.8.0",
Worked for me... I don't know why there are so many breaking changes these days.
+-- UNMET PEER DEPENDENCY @firebase/app@^0.1.0
+-- [email protected]
-- UNMET DEPENDENCY [email protected]
getting this error with rc-4
The below versions worked for me
"angularfire2": "^5.0.0-rc.4",
"firebase": "4.5.0",
On a Christmas, breaking changes!!! I tried below and it worked.
"angularfire2": "5.0.0-rc.4",
"firebase": "4.8.0",
if you roll back to firebase 4.8.0.then the error wil go away..
Tried everything not working.
Current Error -
ERROR in ../../../../node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types/private'.
../../../../node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app-types/private'.
and Versions are
"angularfire2": "^5.0.0-rc.4",
"firebase": "4.8.0",
Also tries this combination
"angularfire2": "5.0.0-rc.4", OR "angularfire2": "5.0.0-rc.5",
"firebase": "4.8.0",
Tried with Yarn as well as Npm
Has anybody still facing the problem.
Facing problem in this git repo
https://github.com/Sandeep3005/ng-chat-app.
Can anybody take a look
@Sandeep3005 did you uninstall the prior firebase version before changing to use firebase: 4.8.0? I made sure to run npm uninstall --save firebase and then ran npm install with firebase: 4.8.0. Although if you already updated to 4.8.0 in package.json, I wouldnt add the --save flag to npm uninstall
So the steps I followed were:
npm uninstall --save firebase
npm install --save [email protected]
Remove the leading ^ in front of resulting package version for firebase
"angularfire2": "5.0.0-rc.0",
"firebase": "4.8.0",
This works for me.
This worked for me: I uninstalled all the old versions from the project and I updated the package.json with the following structure, after that I npm installed and it worked fine.
The reason it is not working is because angularFire2 is trying to get the namespace from /firebase which in the version 4.8.1 changed to /@firebase.
Hope it work for you guys,
"dependencies": {
"@angular/animations": "^5.0.0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/router": "^5.0.0",
"angularfire2": "^5.0.0-rc.5",
"core-js": "^2.4.1",
"firebase": "4.8.0",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
}
@matew17 Good catch! Didn't realize that 馃槀
downgrade firebase to 4.8.0 fixed my issue.
run=> npm install [email protected]
The fix for new people like me:
Go to your terminal:
in your app directory ->
open package.json with your editor of choice (VSCODE in my case)
change "firebase": "^4.8.1" to "firebase": "4.8.0"
command s to save
then in your terminal type->
npm install
you don't have to type update or uninstall because npm should do it for you. in your editor make a note that you changed it so that someday if you have to come back to it you know you changed it.
//changed from "firebase": "^4.8.1" on 12-29-17
you will be glad you did.
That does fix it.
I used this solution, and it works for serving my project locally. However, whenever I try to build the project, I get Error: Metadata version mismatch for module ../node_modules/angularfire2/index.d.ts, found version 4, expected 3. How would I fix this so that my project builds successfully?
spent many days trying to fix this. Disappointed to hear that it was a release issue. Downgrading to firebase 4.8.0 from 4.8.1 fixed it for me
uninstall and reinstall firebase 4.8.0
confirmed it is 4.8.1 is a breaking one.
Hi All,
Can any body tell me how to fix the same thing in Ionic2 project
I have tried every thing which you mentioned above but no luck.
Still i am getting the same issue
Cannot find module '@firebase/app-types/private'.
Users/vyas/node_modules/@firebase/database/dist/esm/src/api/Database.d.ts
Cannot find module '@firebase/app-types/private'.
...rs/vyas/node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts
My package.json - after i downgraded the firebase
"angularfire2": "5.0.0-rc.4",
"firebase": "4.8.0",
Doesn't seem related to this issue, please post it at StackOverflow. @vyasm9
@vyasm9 I'm in an Ionic project and I got it to work by using "angularfire2": "^5.0.0-rc.5" and "firebase": "4.8.0",
I had to delete my node_modules and be sure to not be running the webpack watcher at the same time, then it worked fine.. I have other updating issues but this odd Typescript problem went away
Just to keep everyone up to date, we have a fix in the works but it probably won't be released until next week. Keep on 4.8.0 right now.
Hola, me ocurri贸 lo mismo pero al colocar este c贸digo funciono:
import * as firebase from 'firebase/app';
Espero les sirva :)
@oluway this work for me, thanks!
npm install [email protected] [email protected] --save
[email protected] resolved the issue for me too
I have also experienced this one. On your package.json file check on the dependecies property and update your firebase version.
"dependencies": {
"firebase": "4.8.0"
}
please take note to remove the ^ before the version number as it will install and use the updated version.
@Etosticity work correctly
Solution:
Reason:
Firebase had introduced some breaking changes that AngularFire2 had not coped up with yet. Until the AngularFire2 team work it out, this will be the solution.
Add a thumbs up emoji and direct anyone having the same trouble here! Would save a lot of their time!
I have "angularfire2": "5.0.0-rc.4", and "firebase": "4.8.1", (Downgrading to firebase "4.8.0") and after npm install I Worked here.
Be sure on your package.json file that the firebase and angularfire2 version doesn't have the ^ symbol, otherwise you will be importing version 4.8.1 not 4.8.0.:
Hi all, I had the same issue as most on my MacBook. I pulled my code onto my windows machine and the downgrade works. Not sure what's different between the two, both using VS Code
@MihowBogucki if you search the issue, it's a known issue with firebase 4.8.1
did anyone try 4.8.2?
I restored my package.json to "firebase": "^4.8.0" (which imports4.8.2) and my project compiles with no issue. Issue resolved!
Hi, guys. I'm working with ionic3, angularfire2, and firebase.
But I found two errors 'Cannot find module '@firebase/app-types/private'.
In my package.json,
{
"angularfire2": "^5.0.0-rc.4",
"firebase": "4.8.0",
}
I tried npm uninstall firebase angularfire2 --save, then npm install.
Or removed node_modules directory, and then npm install.
But these didn't solve my issue.
How can I solve this?
Following the above steps (down grading to 4.8.0) does not fix this glitch for me, this is holding up production release;
"dependencies": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "^5.2.0",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@angular/router": "^5.2.0",
"@ionic-native/core": "4.4.0",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "4.4.0",
"@ionic/storage": "2.1.3",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^4.1.1",
"@ngrx/store": "^4.1.1",
"add": "^2.0.6",
"angularfire2": "^5.0.0-rc.4",
"cordova-android": "7.0.0",
"cordova-plugin-device": "^1.1.7",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-splashscreen": "~4.0.1",
"cordova-plugin-whitelist": "^1.3.3",
"firebase": "4.8.0",
"install": "^0.10.2",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"typings": "^2.1.1",
"zone.js": "0.8.18"
},
Updating to version "firebase": "^4.8.2", should fix the issue.
Still struggling with this issue; upgrading like this:
"angularfire2": "^5.0.0-rc.5",
"firebase": "^4.8.2",
still results in this and other errors:
error TS2307: Cannot find module '@firebase/app-types/private'.
Here are my dependencies; please help - struggling for days on this.
"dependencies": {
"@angular/animations": "^5.0.3",
"@angular/common": "^5.0.3",
"@angular/compiler": "^5.0.3",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.0.3",
"@angular/http": "^5.0.3",
"@angular/platform-browser": "^5.0.3",
"@angular/platform-browser-dynamic": "^5.0.3",
"@angular/router": "^5.2.0",
"angularfire2": "^5.0.0-rc.5",
"core-js": "^2.4.1",
"firebase": "^4.8.2",
"firebase-admin": "^5.8.0",
"firebase-functions": "^0.8.0",
"rxjs": "^5.5.2",
"zone.js": "^0.8.14"
},
@a-cordoba10 @rts-cwalker @myspivey @hiepxanh @rezid @timstoute @JimmyOnGitHub @YoungsooJang @houfu @nueko @jhcao23 @nunesdaniel @MihowBogucki @tuballeonel @oluway @kamrulhassan
Can you try npm i angularfire2@next and see if it fixes this issue?
Thank you @davideast - webpack now compiles successfully here.
work great, love you @davideast 鉁岋笍
Fixed in the latest release.
In firebase 4.9.0 there is no errors :)
Updating both fixed it for me.
This may help someone.
"angularfire2": "^5.0.0-rc.6",
"firebase": "^4.9.1",
thank you much Daneile-pecora, I updated firebase to "^4.9.1, it's work perfectly.
Can someone help...I'm still getting the same issue. Followed all of the steps above to install "firebase": "4.8.0",
`[20:53:56] typescript: node_modules/angularfire2-offline/database/angularfire2-interfaces.d.ts, line: 7
Namespace 'firebase' has no exported member 'Promise'.
L6: snapshotCase?: () => firebase.Promise<void>;
L7: unwrappedSnapshotCase?: () => firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2-offline/database/object/afo-object-observable.d.ts, line: 53
Namespace 'firebase' has no exported member 'Promise'.
L53: remove(): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2-offline/database/object/afo-object-observable.d.ts, line: 63
Namespace 'firebase' has no exported member 'Promise'.
L63: set(value: any): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/app/firebase.app.module.d.ts, line: 5
Class 'FirebaseApp' incorrectly implements interface 'App'. Property 'firestore' is missing in type
'FirebaseApp'.
L4: export declare const FirebaseAppConfigToken: InjectionToken<FirebaseAppConfig>;
L5: export declare class FirebaseApp implements firebase.app.App {
L6: name: string;
[20:53:56] typescript: node_modules/angularfire2/app/firebase.app.module.d.ts, line: 12
Namespace 'firebase' has no exported member 'Promise'.
L11: storage: () => firebase.storage.Storage;
L12: delete: () => firebase.Promise<any>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_list_observable.d.ts, line: 14
Namespace 'firebase' has no exported member 'Promise'.
L13: push(val: any): firebase.database.ThenableReference;
L14: update(item: FirebaseOperation, value: Object): firebase.Promise<void>;
L15: remove(item?: FirebaseOperation): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_list_observable.d.ts, line: 15
Namespace 'firebase' has no exported member 'Promise'.
L14: update(item: FirebaseOperation, value: Object): firebase.Promise<void>;
L15: remove(item?: FirebaseOperation): firebase.Promise<void>;
L16: _checkOperationCases(item: FirebaseOperation, cases: FirebaseOperationCases): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_list_observable.d.ts, line: 16
Namespace 'firebase' has no exported member 'Promise'.
L15: remove(item?: FirebaseOperation): firebase.Promise<void>;
L16: _checkOperationCases(item: FirebaseOperation, cases: FirebaseOperationCases): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_object_observable.d.ts, line: 11
Namespace 'firebase' has no exported member 'Promise'.
L10: lift<T, R>(operator: Operator<T, R>): Observable<R>;
L11: set(value: any): firebase.Promise<void>;
L12: update(value: Object): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_object_observable.d.ts, line: 12
Namespace 'firebase' has no exported member 'Promise'.
L11: set(value: any): firebase.Promise<void>;
L12: update(value: Object): firebase.Promise<void>;
L13: remove(): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/database/firebase_object_observable.d.ts, line: 13
Namespace 'firebase' has no exported member 'Promise'.
L12: update(value: Object): firebase.Promise<void>;
L13: remove(): firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/interfaces.d.ts, line: 12
Namespace 'firebase' has no exported member 'Promise'.
L11: export interface FirebaseOperationCases {
L12: stringCase: () => firebase.Promise<void>;
L13: firebaseCase?: () => firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/interfaces.d.ts, line: 13
Namespace 'firebase' has no exported member 'Promise'.
L12: stringCase: () => firebase.Promise<void>;
L13: firebaseCase?: () => firebase.Promise<void>;
L14: snapshotCase?: () => firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/interfaces.d.ts, line: 14
Namespace 'firebase' has no exported member 'Promise'.
L13: firebaseCase?: () => firebase.Promise<void>;
L14: snapshotCase?: () => firebase.Promise<void>;
L15: unwrappedSnapshotCase?: () => firebase.Promise<void>;
[20:53:56] typescript: node_modules/angularfire2/interfaces.d.ts, line: 15
Namespace 'firebase' has no exported member 'Promise'.
L14: snapshotCase?: () => firebase.Promise<void>;
L15: unwrappedSnapshotCase?: () => firebase.Promise<void>;
[20:53:56] typescript: src/pages/home/home.ts, line: 154
Namespace 'firebase' has no exported member 'Promise'.
L154: logoutOfFacebook():firebase.Promise<void> {
L155: //const userId:string = firebase.auth().currentUser.uid;
[20:53:56] typescript: src/pages/settings/settings.ts, line: 88
Namespace 'firebase' has no exported member 'Promise'.
L88: logoutOfFacebook(): firebase.Promise<void> {
L89: //const userId:string = firebase.auth().currentUser.uid;
[20:53:56] typescript: src/providers/firebase-service/firebase-service.ts, line: 25
Property 'database' does not exist on type 'AngularFireDatabase'.
L24: this.userId = user.uid
L25: this.setSettings = this.afDatabase.database.ref(`/users/${user.uid}/settings`);
L26: });
[20:53:56] typescript: src/providers/firebase-service/firebase-service.ts, line: 36
Cannot find namespace 'firebase'.
L36: firebase.Promise<any>{
L37: return this.afDatabase.object(`/users/${this.userId}/settings`).set({ location,
[20:53:56] typescript: src/providers/login-service/login-service.ts, line: 27
Property 'database' does not exist on type 'AngularFireDatabase'.
L26: setUpUser(_credentials, _authData) {
L27: this.ref = this.afDatabase.database.ref('/users/' + _authData.uid)
L28: this.data = {
Error: Failed to transpile program
at new BuildError (/Users/laroca/Documents/Mundo/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/laroca/Documents/Mundo/node_modules/@ionic/app-scripts/dist/transpile.js:159:20
at Promise (
at transpileWorker (/Users/laroca/Documents/Mundo/node_modules/@ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/Users/laroca/Documents/Mundo/node_modules/@ionic/app-scripts/dist/transpile.js:64:12)
at /Users/laroca/Documents/Mundo/node_modules/@ionic/app-scripts/dist/build.js:109:82
at
I am still getting the same error on
"firebase": "^5.0.3",
"angularfire2": "^5.0.0-rc.9",
@arashbi Looks like they released 5.0.0-rc.10 the day after you posted. The following combination is working for me:
"angularfire2": "^5.0.0-rc.10",
"firebase": "^5.0.3",
@ZenPylon I have the same combination, however, I get the following error:
ERROR in node_modules/@firebase/auth-types/index.d.ts(271,21): error TS2314: Generic type 'Observer<V, E>' requires 2 type argument(s).
node_modules/@firebase/auth-types/index.d.ts(276,21): error TS2314: Generic type 'Observer<V, E>' requires 2 type argument(s).
node_modules/@firebase/storage-types/index.d.ts(80,9): error TS2314: Generic type 'Observer<V, E>' requires 2 type argument(s).
Friends, I have a problem. In trying to install firebase, I add this :
"angularfire2": "^5.0.0-rc.6",
"firebase": "^4.9.1",
to my dependencies.
But I have this error:
npm ERR! code ERR_STREAM_WRITE_AFTER_END
npm ERR! write after end
Please help me.
Thank you.
Also I would like to know the usefulness of : "promise-polyfill": "^6.0.2",
Is it necessary to include it too ?
here are my dependencies;
"dependencies": {
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/compiler-cli": "5.0.0",
"@angular/core": "5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@ionic-native/core": "^4.3.1",
"@ionic-native/in-app-browser": "^4.3.1",
"@ionic-native/splash-screen": "^4.3.1",
"@ionic-native/status-bar": "^4.3.1",
"@ionic/storage": "2.1.3",
"angularfire2": "^5.0.0-rc.6",
"cordova-android": "^6.2.3",
"cordova-ios": "^4.5.2",
"cordova-plugin-crosswalk-webview": "^2.3.0",
"cordova-plugin-device": "^1.1.6",
"cordova-plugin-inappbrowser": "^1.7.1",
"cordova-plugin-ionic-keyboard": "^2.0.2",
"cordova-plugin-ionic-webview": "^1.1.15",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.3",
"cordova-plugin-whitelist": "^1.3.2",
"ionic-angular": "3.9.2",
"firebase": "^4.9.1",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.5",
"typescript": "~2.4.2"
},
{
"name": "firestarter",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test --watch false",
"lint": "ng lint",
"e2e": "cypress open",
"build:all": "ng build --prod && ng run firestarter:server && npm run webpack:prerender && npm run prerender",
"serve:prerender": "http-server dist/firestarter -c-1",
"webpack:prerender": "webpack --config webpack.prerender.config.js",
"prerender": "node dist/firestarter/prerender.js"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.0.1",
"@angular/common": "^6.0.1",
"@angular/compiler": "^6.0.1",
"@angular/core": "^6.0.1",
"@angular/forms": "^6.0.1",
"@angular/http": "^6.0.1",
"@angular/platform-browser": "^6.0.1",
"@angular/platform-browser-dynamic": "^6.0.1",
"@angular/platform-server": "^6.0.1",
"@angular/pwa": "^0.6.1",
"@angular/router": "^6.0.1",
"@angular/service-worker": "^6.0.1",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"angularfire2": "^5.0.0-rc.9",
"core-js": "^2.5.4",
"firebase": "^5.0.2",
"rxjs": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.6.1",
"@angular/cli": "~6.0.1",
"@angular/compiler-cli": "^6.0.1",
"@angular/language-service": "^6.0.1",
"@cypress/webpack-preprocessor": "^2.0.1",
"@types/chance": "^1.0.1",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"bulma": "^0.7.1",
"chance": "^1.0.16",
"codelyzer": "~4.2.1",
"cypress": "^3.0.1",
"firebase-tools": "^3.18.6",
"fs-extra": "^6.0.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~1.4.2",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-loader": "^4.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2",
"webpack-cli": "^2.1.3",
"ws": "^5.1.1",
"xmlhttprequest": "^1.8.0"
}
}
The following combination is working for me:
$npm install --save [email protected] [email protected]
"angularfire2": "^5.0.0-rc.10",
"firebase": "^5.0.3",
This Combination is not working for me
"angularfire2": "^5.0.0-rc.10",
"firebase": "^5.0.3", .
Nor this
"angularfire2": "^5.0.0-rc.10",
"firebase": "^4.8.0", .
I'm using angular 8 and ionic 5. please help if you got desired solution'
@VajpayeeShashi why don't you use "@angular/fire && firebase" Because this is an old issue unless you're working on a legacy project using "angularfire2" the when importing firebase try using "firebase/app"
I am not using the "angularfire2" I "@angular/fire": "^6.0.0", "firebase": "^7.14.6", still i get this : ERROR in node_modules/@angular/fire/angularfire2.d.ts(37,49): error TS2344: Type 'T[K]' does not satisfy the constraint '(...args: any) => any'.
If I add "skipLibCheck": true, it is working any ideas.
Thanks in advance
Most helpful comment
@rts-cwalker The same happened to me.
Changing it to firebase 4.8.0 fixed the issue as stated in the other thread.