Skip to content
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

ERROR in [default] Cannot find type definition file for 'firebase'. #525

Closed
k1ng440 opened this issue Sep 17, 2016 · 55 comments
Closed

ERROR in [default] Cannot find type definition file for 'firebase'. #525

k1ng440 opened this issue Sep 17, 2016 · 55 comments

Comments

@k1ng440
Copy link

k1ng440 commented Sep 17, 2016

Hello,
I have tried every possible solution to fix this issue but none helps remove this error message.

tsconfig.json

{
  "compilerOptions": {
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "lib": [
      "es6",
      "dom"
    ],
    "types": [
      "firebase",
      "jasmine",
      "node",
      "protractor",
      "selenium-webdriver"
    ],
    "typeRoots": [
      "../node_modules/@types"
    ],
    "mapRoot": "./",
    "module": "commonjs",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "exclude": [
      "node_modules",
      "dist"
    ]
  }
}

packages.json

    "angularfire2": "^2.0.0-beta.5-preview",
    "firebase": "^3.4.0",
tsc -v                                                                                                                                                                                                                                     
Version 2.0.0
angular-cli: 1.0.0-beta.11-webpack.8                                                                                                                                                                                                                       
node: 6.5.0                                                                                                                                                                                                                                                
os: win32 x64                                                                                                                                                                                                                                              
@nydal91
Copy link

nydal91 commented Sep 17, 2016

I have the same problem...

@nydal91
Copy link

nydal91 commented Sep 18, 2016

it work when i follow the Troubleshooting.
https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md

tsconfig.json:

{ "compilerOptions": { "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], "mapRoot": "./", "module": "es6", "moduleResolution": "node", "outDir": "../dist/out-tsc", "sourceMap": true, "target": "es5", "typeRoots": [ "../node_modules/@types" ], "types": [ "firebase" ] } }

@k1ng440
Copy link
Author

k1ng440 commented Sep 18, 2016

you added "firebase" to types, right?

it didnt work for me

@nydal91
Copy link

nydal91 commented Sep 18, 2016

I don't understand the question. but I just restart the guide to I get it to work. toke some time.

@mukesh51
Copy link
Contributor

@k1ng440 I'll recommend try the install guide again. you "ng -v" gives angular-cli: 1.0.0-beta.11-webpack.8 , where as angular-cli has got updated. so may be worth un-installing and re-installing angular-cli. Also, I've faced issues on windows system and have seen others also facing different issues on windows, but everything seems to be working fine on linux based system. Just so you know.

@manekinekko
Copy link

manekinekko commented Sep 18, 2016

I could reproduce this issue. It guess this might be a regression, because it seemed to be fixed in early versions.

I don't know if it's related to angularfire2 or angular-cli

//cc @TheLarkInn @davideast any idea?

angular-cli: local (v1.0.0-beta.14, branch: master)
node: 6.4.0
os: darwin x64
@angular/core: ^2.0.0
angularfire2: ^2.0.0-beta.5
firebase: ^3.4.0

@jeffbcross
Copy link
Contributor

@k1ng440 I'm curious, is the firebase package installed in your root node_modules (i.e. your-app/node_modules/firebase), or is it just installed inside your-project/node_modules/angularfire2/node_modules/firebase?

@k1ng440
Copy link
Author

k1ng440 commented Sep 19, 2016

i have firebase on node_modules/firebase and angularfire2/node_modules/firebase

@jeffbcross
Copy link
Contributor

jeffbcross commented Sep 19, 2016

@k1ng440 thanks. This might be an issue with AF2 still depending on 3.3.0, and TypeScript might not be resolving the types correctly since there are two instances of firebase.

As an experiment, could you delete node_modules/angularfire2/node_modules/firebase and then see if the problem is solved?

@k1ng440
Copy link
Author

k1ng440 commented Sep 19, 2016

removed and it didn't solve the issue

@jeffbcross
Copy link
Contributor

@alexeagle and I have tracked down the issue. None of our .d.ts files include any imports from firebase, which is causing node_modules/firebase/firebase.d.ts never to be loaded. If firebase.d.ts ever gets loaded, it would add firebase to the ambient typings and make these errors go away. I'm going to refactor all of our modules to properly import from firebase instead of relying on ambient typings.

In the meantime, you should be able to work around this problem by adding a reference to your project's entry file pointing directly to firebase.d.ts

/// <reference path="node_modules/firebase/firebase.d.ts" />

@k1ng440
Copy link
Author

k1ng440 commented Sep 20, 2016

i tried to add
/// <reference path="node_modules/firebase/firebase.d.ts" /> to main.ts, typings.d.ts and app.module.ts. none of them solves this issue

thanks

@mukesh51
Copy link
Contributor

Try adding it into "files" list in the tsconfig.json

@alexeagle
Copy link

@k1ng440 is that the right relative path, or does it need some ../ on the front?

@dmastag
Copy link
Contributor

dmastag commented Sep 20, 2016

@k1ng440 I solved it by either adding

import * as firebase from 'firebase';

or

///

on top of node_modules\angularfire2\angularfire2.d.ts

As mentioned over here ->
#486 (comment)

For non-Windows users this should be solved by adding firebase into the types array of your tsconfig file.

@k1ng440
Copy link
Author

k1ng440 commented Sep 20, 2016

i have both in app.modules.ts and it doesn't work :(

@dmastag
Copy link
Contributor

dmastag commented Sep 20, 2016

@k1ng440 Try changing the angularfire2.d.ts file directly like I mentioned

@k1ng440
Copy link
Author

k1ng440 commented Sep 21, 2016

Hi,
Yes i have used ../ but still doesn't help me

/// <reference path="../../node_modules/firebase/firebase.d.ts" />

@mukesh51
Copy link
Contributor

@jeffbcross Hopefully, this should remove the need to add firebase entry in types arrays in 'src/tsconfig.json' ?

@jeffbcross
Copy link
Contributor

@mukesh51 yep!

@csotomon
Copy link

csotomon commented Oct 6, 2016

Hi, is this fixed in the npm package?

@k1ng440
Copy link
Author

k1ng440 commented Oct 6, 2016

@csotomon yes

dont add to tsconfig.json and you should be fine

@csotomon
Copy link

csotomon commented Oct 7, 2016

In mac OS X works perfect, but in Windows 10 dont.

C:\proyectos\testFirebase>ng serve
** NG Live Development Server is running on http://localhost:4200. **
6541ms building modules
31ms sealing
0ms optimizing
0ms basic module optimization
94ms module optimization
0ms advanced module optimization
16ms basic chunk optimization
0ms chunk optimization
0ms advanced chunk optimization
0ms module and chunk tree optimization
125ms module reviving
0ms module order optimization
0ms module id optimization
0ms chunk reviving
0ms chunk order optimization
15ms chunk id optimization
63ms hashing
0ms module assets processing
140ms chunk assets processing
0ms additional chunk assets processing
0ms recording
0ms additional asset processing
1860ms chunk asset optimization
1375ms asset optimization
47ms emitting
Hash: 2e01e12af9286806d79f
Version: webpack 2.1.0-beta.22
Time: 10322ms
Asset Size Chunks Chunk Names
main.bundle.js 3.27 MB 0, 2 [emitted] main
styles.bundle.js 10.2 kB 1, 2 [emitted] styles
inline.js 5.53 kB 2 [emitted] inline
main.map 3.4 MB 0, 2 [emitted] main
styles.map 14 kB 1, 2 [emitted] styles
inline.map 5.59 kB 2 [emitted] inline
index.html 479 bytes [emitted]
assets/.npmignore 0 bytes [emitted]

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\angularfire2.d.ts:13:65
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\angularfire2.d.ts:15:45
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:9:39
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:10:51
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:10:91
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:11:50
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:11:118
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:14:55
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:6:81
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:8:48
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:13:45
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:40:10
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:42:13
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:43:13
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:44:14
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:45:15
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:48:54
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:48:84
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:5:13
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:6:24
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:14:72
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:16:35
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:17:36
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\database.d.ts:8:28
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\database.d.ts:9:30
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_factory.d.ts:3:73
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_factory.d.ts:3:103
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:6:49
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:6:79
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:8:10
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:8:40
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:9:22
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:9:52
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:11:20
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:12:52
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:13:38
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:14:82
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_factory.d.ts:3:75
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:7:101
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:9:21
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:10:27
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:11:14
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:9:22
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:10:25
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:11:25
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:12:34
Cannot find namespace 'firebase'.

ERROR in [default] C:\proyectos\testFirebase\src\typings.d.ts:6:12
Subsequent variable declarations must have the same type. Variable 'require' must be of type 'NodeRequire', but here has type 'any'.

ERROR in [default] C:\proyectos\testFirebase\src\typings.d.ts:7:12
Subsequent variable declarations must have the same type. Variable 'module' must be of type 'NodeModule', but here has type 'any'.
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 2.81 kB 0
webpack: bundle is now VALID.

@lednhatkhanh
Copy link

Tried adding

import * as firebase from 'firebase';

and got this these errors instead:

ERROR in [default] C:\Users\lednh\Documents\ng2\ng2-simple-todos\node_modules\@types\firebase\index.d.ts:326:1                 
Duplicate identifier 'export='.                                                                                                

ERROR in [default] C:\Users\lednh\Documents\ng2\ng2-simple-todos\node_modules\firebase\firebase.d.ts:405:2                     
Duplicate identifier 'export='.

@mukesh51
Copy link
Contributor

mukesh51 commented Nov 2, 2016

@lednhatkhanh try removing the import * as firebase from 'firebase'; from angularfire.d.ts and then restart ng serve

@soccio
Copy link

soccio commented Nov 3, 2016

@mukesh51 Removing all the "import * as firebase from 'firebase';" added to commit/c3a954c worked for me.

@chrste90
Copy link

chrste90 commented Nov 3, 2016

I think a better idea is to delete firebase from @types folder.

@bogacg
Copy link

bogacg commented Nov 3, 2016

In my case, just removing firebase from types array in tsconfig.json did not fix this issue, but also I had to remove import 'firebase' from vendor.ts file.
Which reminds me an issue I've previously reported #521

@razvantomegea
Copy link

razvantomegea commented Nov 15, 2016

npm install --save angularfire2 firebase
In tsconfig.json add:

"files": [
      "../node_modules/firebase/firebase.d.ts"
    ]

In anglar-cli.json file add:

"scripts": [
        "../node_modules/firebase/firebase.js",
]

And in typings.d.ts file add:

declare var System: any;
declare var require: any;
declare var module: any;

Close the server and re-run ng serve
There is no need to install @types/firebase and add firebase to types array
Upgrade from Angular 2.RC4 to final with Angular-CLI

@EnricoPicci
Copy link

I tried some of the workarounds listed in the answers but I am not able to solve the problem.
I still get

"ERROR in [default] 
Cannot find type definition file for 'firebase"

while compiling with Webpack (even if the app starts and works fine).

I am working with:

package.json is
{
"name": "final-project",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "ng serve",
"lint": "tslint "src/**/*.ts"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"populate-db": "./node_modules/.bin/ts-node ./populate-db.ts",
"batch-server": "./node_modules/.bin/ts-node ./batch-server.ts"
},
"private": true,
"dependencies": {
"@angular/common": "2.0.1",
"@angular/compiler": "2.0.1",
"@angular/core": "2.0.1",
"@angular/forms": "2.0.1",
"@angular/http": "2.0.1",
"@angular/platform-browser": "2.0.1",
"@angular/platform-browser-dynamic": "2.0.1",
"@angular/router": "3.0.0",
"@types/lodash": "^4.14.36",
"@types/request": "0.0.30",
"angular2-firebase": "^0.7.3",
"angularfire2": "^2.0.0-beta.4",
"core-js": "^2.4.0",
"firebase-queue": "^1.5.0",
"lodash": "^4.15.0",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.21"
},
"devDependencies": {
"@types/jasmine": "^2.2.30",
"angular-cli": "1.0.0-beta.16",
"codelyzer": "~0.0.26",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "0.13.22",
"karma-chrome-launcher": "0.2.3",
"karma-jasmine": "0.3.8",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.3",
"ts-node": "^1.2.1",
"tslint": "3.13.0",
"typescript": "^2.0.2"
}
}

tsconfig.json is

{
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": ["es6", "dom"],
    "mapRoot": "./",
    "module": "es6",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ],
    "types": [
      "node",
      "firebase"
    ]
  }
}

typings.d.ts is

// Typings reference file, see links for more information
// https://github.com/typings/typings
// https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html

declare var System: any;

@Splaktar
Copy link
Member

@EnricoPicci the fix should be in beta.6. Are you sure that is being used?

@EnricoPicci
Copy link

I removed 'firebase' from the "types" of typings.d.ts and the error disappeared.
This was already suggested as a solution in this thread but, for reasons which are not clear to me, it did not work before in my case.
Thanks for the support

@timeens
Copy link

timeens commented Dec 19, 2017

Had the same error after upgrading nodejs on Windows 10 to v.8.9.3. Using Angulafire v.5.0.0-rc.4

Fixed it by removing
import * as firebase from 'firebase/app';
from
node_modules\angularfire2\firebase.app.module.d.ts

@meanMonk
Copy link

@timeens ,
I am stiill facing some issue after removing
import * as firebase from 'firebase/app'; from file you have suggested..

Here is error:
ERROR in node_modules/angularfire2/firebase.app.module.d.ts(4,45): error TS2503: Cannot find namespace 'fir node_modules/angularfire2/firebase.app.module.d.ts(7,17): error TS2503: Cannot find namespace 'firebase'. node_modules/angularfire2/firebase.app.module.d.ts(8,21): error TS2503: Cannot find namespace 'firebase'. node_modules/angularfire2/firebase.app.module.d.ts(9,22): error TS2503: Cannot find namespace 'firebase'. node_modules/angularfire2/firebase.app.module.d.ts(10,20): error TS2503: Cannot find namespace 'firebase'. node_modules/angularfire2/firebase.app.module.d.ts(12,22): error TS2503: Cannot find namespace 'firebase'.

Node Version: v8.4.0
Angular cli :
Angular CLI: 1.6.1
Node: 8.4.0
OS: win32 x64
Angular: 5.1.1

Here is the dependencies

"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-next", "bootstrap": "^4.0.0-beta.2", "core-js": "^2.4.1", "firebase": "^4.8.1", "font-awesome": "^4.7.0", "jquery": "^3.2.1", "rxjs": "^5.5.2", "zone.js": "^0.8.14" }, "devDependencies": { "@angular/cli": "1.6.1", "@angular/compiler-cli": "^5.0.0", "@angular/language-service": "^5.0.0", "@types/firebase": "^2.4.32", "@types/jasmine": "~2.5.53", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.6.2", "jasmine-spec-reporter": "~4.1.0", "karma": "~1.7.0", "karma-chrome-launcher": "~2.1.1", "karma-cli": "~1.0.1", "karma-coverage-istanbul-reporter": "^1.2.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.1.2", "ts-node": "~3.2.0", "tslint": "~5.7.0", "typescript": "~2.4.2" }

Can you guys' please help me out with this.
I have tried all possible solution suggested in all the issue on github and also updated the angular cli and created new project as well still facing same issue.

Thank you in adavance.

@ghost
Copy link

ghost commented Dec 19, 2017

@meanMonk,

I had the same issue last night, I was able to resolve it by rolling the firebase dependency back to 4.6.0. I didn’t get to look into the root cause of the differences between 4.6.0 definitions and 4.8.1 definitions, but this definitely solved it for me.

@jahmani
Copy link

jahmani commented Dec 19, 2017

Thank you very much @meanMonk , you saved my time, faced the same issue after upgrading ionic2 project.
resolved by rolling the firebase dependency back to 4.6.0

@meanMonk
Copy link

@giannico ,
Can you please share the version of angularfire2 which you are using in your project as well?

@meanMonk
Copy link

Thank you, @giannico .
Issue resolved now.
I really appreciate your help.

@huuquyasb
Copy link

huuquyasb commented Dec 20, 2017

firebase_error
@giannico Thanks. I changed 4.8.0 to 4.6.0 in package.json and run "npm install" => Now it working.

@nueko
Copy link

nueko commented Dec 20, 2017

@huuquyasb what about npm exact option?

@Methodician
Copy link

Methodician commented Dec 20, 2017

@giannico I spent like half the day battling this! At least it got me to update most of my packages in the process... THANKS!

I hope they get things fixed up. Hate to leave a package a few versions back.

@bogacg
Copy link

bogacg commented Dec 20, 2017

I don't see the need to go back to 4.6.0. Like @nueko said, 4.8.0 works as well.

@NilsNaegele
Copy link

NilsNaegele commented Dec 20, 2017

I have tried everything on this thread: newest version of everything angular here: i want to deploy.
ERROR in node_modules/angularfire2/firebase.app.module.d.ts(5,45): error TS2503: Cannot find namespace 'firebase'.
node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app-types/private'.
node_modules/angularfire2/database/interfaces.d.ts(3,50): error TS2503: Cannot find namespace 'firebase'.
node_modules/angularfire2/database/database.d.ts(7,15): error TS2503: Cannot find namespace 'database'.
node_modules/angularfire2/database/list/state-changes.d.ts(7,113): error TS2503: Cannot find namespace 'database'.
node_modules/angularfire2/database/list/audit-trail.d.ts(7,133): error TS2503: Cannot find namespace 'database'.

4 weeks ago this exact same setup worked like a charm in atom. now switched to vscode.

@nueko
Copy link

nueko commented Dec 20, 2017

@NilsNaegele have you tried to delete the node_modules directory? or further also delete the .lock file
then run

npm install
// then 
npm install --save-exact firebase
// or
yarn
// then
yarn add -E firebase

@NilsNaegele
Copy link

redid everything and now it works. deleted the .lock file. @nueko thanks.

@natrayanp
Copy link

Nothing worked but going back to "firebase":"4.6.0" worked

@nueko
Copy link

nueko commented Dec 20, 2017

@natrayanp don't forget to verify the installation by npm list firebase

@moi-j
Copy link

moi-j commented Dec 21, 2017

Same error. Going back to 4.6.0.

@uceph
Copy link

uceph commented Dec 25, 2017

@MohamedHmini
Copy link

i had the same problem and i solved it by downgrading the version of the FIREBASE :
npm install [email protected] --save-dev

@pedromassango
Copy link

i had the same problem and i solved it by downgrading the version of the FIREBASE :
npm install [email protected] --save-dev

Just did this and it worked

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