Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Cannot use firebase.firestore and other namespaces types after upgrading to 8.0.0 #4004
Comments
Interesting. Are you using script tags to include firebase, and use firebase as a global variable in your module files? Just trying to understand why you only want to import types. Yes, it's recommended to explicit import firebase for namespace types in modules. The global types become a little awkward to use now( you have to add You probably don't need to use type-only imports, unless you use |
The app is bundled with webpack. It's a React app and our code is structured in a way that there is a single context provider that does Apart from that there were a couple of places where global types were useful before:
I think that both of the later can be solved by directly importing types with minimal changes. For the former, adding type imports to many components doesn't look that pretty, but I guess it's better than adding |
That makes sense. Thanks for the clarification! I will close the issue now. |
After upgrading to 8.0 directly using
firebase.firestore
or any other product namespaces types doesn't work.This doesn't work:
The typescript error:
Namespace '"..../node_modules/firebase/index"' has no exported member 'firestore'.ts(2694)
This works:
As well as this:
What is the correct way to use these namespace types in modules? Should the explicit type import be used going forward instead of relying on the global declaration?