-
Notifications
You must be signed in to change notification settings - Fork 926
5.0.4 Does not compile in node environment / typescript definitions.. #880
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
Comments
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight. |
I have the same problem. Had to go back to [email protected] to be able to deploy my functions. |
I also have same problem when upgrade to [email protected] when compile for my probject. |
I am getting an error: error TS2339: Property 'auth' does not exist on type 'FirebaseNamespace' |
+1 |
1 similar comment
+1 |
I had the same problem:
A fix, as mentioned above, is to downgrade |
After updating to 5.1.0, the error still exists, but the line number is different.
|
A workaround is to add @jshcrowthe This is not an issue with Messaging. Our packages assume that DOM types exist. The problem is that importing Some of our packages (like Messaging) only work in the browser. These packages (or their types) should not be imported in a Node environment. |
@mmermerkaya , Is there a list of these packages somewhere? Messaging makes sense, but it would be nice to know which ones to avoid. |
There's this: https://github.com/firebase/firebase-js-sdk/blob/master/ENVIRONMENTS.md It's missing Firestore and Functions at the moment, but there's already an issue about that: #914. |
@mmermerkaya , thank you very much! That will be very useful for us. |
So when you say add "dom" I'm not sure what exactly you mean. Can someone point me in the right direction? Thanks in advance! The specific firebase method I'm looking to use in my cloud function is |
@shawnmitchell |
… error due to missing type (reference: firebase/firebase-js-sdk#880 (comment)) htbkoo/hey-hkul-hours-native-ns-vue
The suggested/promoted workaround here of adding "dom" to /// <reference lib="dom" />
import * as firebase from 'firebase'; That first line is a "triple-slash lib directive" (https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) first available in TypeScript 3.0. It's like adding To fix this problem officially and permanently we should remove "dom" from the tsconfig libs in this project and instead add the line |
Just curious why @carnesen 's suggestion hasn't been adopted yet. =( It has also come up in this stack overflow... |
Hi @mmermerkaya , this is still an issue. I understand that importing |
I've since learned that |
If I understand your question correctly, no, this is not the case. Importing |
@seankwalker A workaround is using scoped packages, e.g. |
thanks @Feiyang1 that worked perfectly! Sorry, I hadn't seen the |
These issues don't seem applicable after the v9 modular rewrite, feel free to open a new issue for similar errors in v9 and above. |
[REQUIRED] Describe your environment
[REQUIRED] Describe the problem
Steps to reproduce:
Can't compile Node project. Compiles fine with 4.13.1.
Update: just tried this again, and 5.0.0 works, but 5.0.1, 5.0.2, 5.0.3 and 5.0.4 all fail with that message.
Relevant Code:
node_modules/firebase/index.d.ts(578,36): error TS2304: Cannot find name 'ServiceWorkerRegistration'.
The text was updated successfully, but these errors were encountered: