Skip to content

ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'. #1387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
a-cordoba10 opened this issue Dec 19, 2017 · 89 comments

Comments

@a-cordoba10
Copy link

Angular: 5.0

Firebase: 4.8.1

AngularFire: 5.0.0-rc.4

Other (e.g. Ionic/Cordova, Node, browser, operating system):
no

How to reproduce these conditions

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

Debug output

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

Expected behavior

Project compiles successfully

Actual behavior

The project doesn't compile

@a-cordoba10 a-cordoba10 changed the title RROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'. ERROR in node_modules/angularfire2/auth/auth.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'. Dec 19, 2017
@vt-cwalker
Copy link

vt-cwalker commented Dec 19, 2017

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 #1385

There is a PR open for this issue. #1386

@a-cordoba10
Copy link
Author

@rts-cwalker The same happened to me.

Changing it to firebase 4.8.0 fixed the issue as stated in the other thread.

@vt-cwalker
Copy link

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

@a-cordoba10
Copy link
Author

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

@myspivey
Copy link
Contributor

@a-cordoba10 that is 4.8.1 catching ya firebase/firebase-js-sdk#387 (comment)

@a-cordoba10
Copy link
Author

@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

@myspivey
Copy link
Contributor

Think AF2 is grabbing it and some fighting is going on. Try seeing what is inside AF2.

@vt-cwalker
Copy link

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

@vt-cwalker
Copy link

vt-cwalker commented Dec 20, 2017

@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

@hiepxanh
Copy link
Contributor

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 ?

@vt-cwalker
Copy link

@hiepxanh there is already a PR open to fix. #1386

@hiepxanh
Copy link
Contributor

@rts-cwalker thanks, I don't see that, Can't believe they release breaking change in xmas

@vt-cwalker
Copy link

vt-cwalker commented Dec 20, 2017

Whats just as shocking is that its released as a "patch" release.. Breaking changes should AT LEAST be minor version release.

@rezid
Copy link

rezid commented Dec 20, 2017

finally !!! i know the problem and could fix it with a downgrade to 4.8.0

@mbejda
Copy link

mbejda commented Dec 20, 2017

Can we get a warning next before breaking changes come in....

@colinskow
Copy link

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.

@mayordwells
Copy link

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?

@myspivey
Copy link
Contributor

mayordwells you need to downgrade Firebase to 4.8.0. That will resolve till a fix is out.

@asgarli
Copy link
Contributor

asgarli commented Dec 21, 2017

Downgrading to firebase 4.8.0 fixed it for me

@mayordwells
Copy link

@asgarli Thanks, I'll try to do the same.

@darlondjc
Copy link

darlondjc commented Dec 21, 2017

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"
}

@myspivey
Copy link
Contributor

@darlondjc can you verify what /node_modules/firebase/package.json reports as the version? Your setup looks fine.

@darlondjc
Copy link

@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"
}

@andriandresson
Copy link

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"
},

@darlondjc
Copy link

"angularfire2": "5.0.0-rc.5", and "firebase": "4.8.0" did not work yet. :(

@fazanki
Copy link

fazanki commented Dec 22, 2017

"angularfire2": "5.0.0-rc.5", and "firebase": "4.8.0" did work for me :)

@cdosorio
Copy link

@darlondjc , did you ran npm update on the root folder? I was missing that step

@darlondjc
Copy link

@cdosorio i did it right now (again), just for confirm, but stays the same error.

typescript error
Cannot find type definition file for 'firebase'.

@danielnunesdc
Copy link

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

@MihowBogucki
Copy link

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

@nueko
Copy link

nueko commented Jan 11, 2018

@MihowBogucki if you search the issue, it's a known issue with firebase 4.8.1

@jhcao23
Copy link

jhcao23 commented Jan 11, 2018

did anyone try 4.8.2?

@houfu
Copy link
Contributor

houfu commented Jan 11, 2018

I restored my package.json to "firebase": "^4.8.0" (which imports 4.8.2) and my project compiles with no issue. Issue resolved!

@YoungsooJang
Copy link

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?

@JimmyOnGitHub
Copy link

JimmyOnGitHub commented Jan 16, 2018

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"
},

@hkandie
Copy link

hkandie commented Jan 16, 2018

Updating to version "firebase": "^4.8.2", should fix the issue.

@timstoute
Copy link

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"
},

@davideast
Copy link
Collaborator

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

@timstoute
Copy link

timstoute commented Jan 16, 2018

Thank you @davideast - webpack now compiles successfully here.

@hiepxanh
Copy link
Contributor

work great, love you @davideast ✌️

@davideast
Copy link
Collaborator

Fixed in the latest release.

@deadzer0
Copy link

deadzer0 commented Feb 2, 2018

In firebase 4.9.0 there is no errors :)

@daniele-pecora
Copy link

Updating both fixed it for me.
This may help someone.

    "angularfire2": "^5.0.0-rc.6",
    "firebase": "^4.9.1",

ne-peer added a commit to ne-peer/deredorm that referenced this issue Feb 9, 2018
@DJFreh
Copy link

DJFreh commented Apr 24, 2018

thank you much Daneile-pecora, I updated firebase to "^4.9.1, it's work perfectly.

@DuaneQ
Copy link

DuaneQ commented May 6, 2018

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 `

@arashbi
Copy link

arashbi commented May 21, 2018

I am still getting the same error on
"firebase": "^5.0.3",
"angularfire2": "^5.0.0-rc.9",

@ZenPylon
Copy link

@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",

@Sliqric7053
Copy link

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

@beli7706
Copy link

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"
},

@JoseRFJuniorLLMs
Copy link

{
"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"
}
}

@tkto
Copy link

tkto commented Jan 12, 2019

The following combination is working for me:
$npm install --save [email protected] [email protected]
"angularfire2": "^5.0.0-rc.10",
"firebase": "^5.0.3",

@VajpayeeShashi
Copy link

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'

@will-abule
Copy link

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

@sujaydinakar
Copy link

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

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

No branches or pull requests