-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Comments
I have the same problem... |
it work when i follow the Troubleshooting. tsconfig.json:
|
you added "firebase" to types, right? it didnt work for me |
I don't understand the question. but I just restart the guide to I get it to work. toke some time. |
@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. |
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?
|
@k1ng440 I'm curious, is the firebase package installed in your root |
i have firebase on node_modules/firebase and angularfire2/node_modules/firebase |
@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 |
removed and it didn't solve the issue |
@alexeagle and I have tracked down the issue. None of our .d.ts files include any imports from 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
|
i tried to add thanks |
Try adding it into "files" list in the tsconfig.json |
@k1ng440 is that the right relative path, or does it need some |
@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 -> For non-Windows users this should be solved by adding firebase into the types array of your tsconfig file. |
i have both in app.modules.ts and it doesn't work :( |
@k1ng440 Try changing the angularfire2.d.ts file directly like I mentioned |
Hi,
|
@jeffbcross Hopefully, this should remove the need to add firebase entry in types arrays in 'src/tsconfig.json' ? |
@mukesh51 yep! |
Hi, is this fixed in the npm package? |
@csotomon yes dont add to tsconfig.json and you should be fine |
In mac OS X works perfect, but in Windows 10 dont.
ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\angularfire2.d.ts:13:65 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\angularfire2.d.ts:15:45 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:9:39 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:10:51 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:10:91 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:11:50 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:11:118 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth.d.ts:14:55 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:6:81 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:8:48 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:13:45 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:40:10 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:42:13 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:43:13 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:44:14 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:45:15 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:48:54 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\auth_backend.d.ts:48:84 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:5:13 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:6:24 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:14:72 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:16:35 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\auth\firebase_sdk_auth_backend.d.ts:17:36 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\database.d.ts:8:28 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\database.d.ts:9:30 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_factory.d.ts:3:73 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_factory.d.ts:3:103 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:6:49 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:6:79 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:8:10 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:8:40 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:9:22 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:9:52 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:11:20 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:12:52 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:13:38 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_list_observable.d.ts:14:82 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_factory.d.ts:3:75 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:7:101 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:9:21 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:10:27 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\database\firebase_object_observable.d.ts:11:14 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:9:22 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:10:25 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:11:25 ERROR in [default] C:\proyectos\testFirebase\node_modules\angularfire2\interfaces.d.ts:12:34 ERROR in [default] C:\proyectos\testFirebase\src\typings.d.ts:6:12 ERROR in [default] C:\proyectos\testFirebase\src\typings.d.ts:7:12 |
Tried adding
and got this these errors instead:
|
@lednhatkhanh try removing the import * as firebase from 'firebase'; from angularfire.d.ts and then restart ng serve |
@mukesh51 Removing all the "import * as firebase from 'firebase';" added to commit/c3a954c worked for me. |
I think a better idea is to delete firebase from @types folder. |
In my case, just removing |
"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 |
I tried some of the workarounds listed in the answers but I am not able to solve the problem.
while compiling with Webpack (even if the app starts and works fine). I am working with:
package.json is tsconfig.json is
typings.d.ts is
|
@EnricoPicci the fix should be in beta.6. Are you sure that is being used? |
I removed 'firebase' from the "types" of typings.d.ts and the error disappeared. |
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 |
@timeens , Here is error: Node Version: v8.4.0 Here is the dependencies
Can you guys' please help me out with this. Thank you in adavance. |
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. |
Thank you very much @meanMonk , you saved my time, faced the same issue after upgrading ionic2 project. |
@giannico , |
Thank you, @giannico . |
|
@huuquyasb what about npm exact option? npm i -E [email protected] |
@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. |
I don't see the need to go back to |
I have tried everything on this thread: newest version of everything angular here: i want to deploy. 4 weeks ago this exact same setup worked like a charm in atom. now switched to vscode. |
@NilsNaegele have you tried to delete the npm install
// then
npm install --save-exact firebase
// or
yarn
// then
yarn add -E firebase |
redid everything and now it works. deleted the .lock file. @nueko thanks. |
Nothing worked but going back to "firebase":"4.6.0" worked |
@natrayanp don't forget to verify the installation by |
Same error. Going back to 4.6.0. |
Same error. but that's work for me: https://stackoverflow.com/questions/47927038/cannot-find-module-firebase-app-types-private |
i had the same problem and i solved it by downgrading the version of the FIREBASE : |
Just did this and it worked |
Hello,
I have tried every possible solution to fix this issue but none helps remove this error message.
tsconfig.json
packages.json
The text was updated successfully, but these errors were encountered: