firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.76k stars 874 forks source link

Typescript types missing when upgrading from 10.2 to 10.3 #8344

Open shaunpersad opened 4 days ago

shaunpersad commented 4 days ago

Operating System

All

Browser Version

All

Firebase SDK Version

10.3

Firebase SDK Product:

Auth

Describe your project's tooling

React app with Vite inside a monorepo

Describe the problem

I recently had to upgrade our firebase SDK from 9 to 10 and discovered the Typescript types have completely gone missing. I was able to test out exact versions of the 10.x SDK and saw that types were correctly found up until version 10.3.0. Auth is the only part of the SDK we use so I did not test out the other products to see if they also have the same issue.

Steps and code to reproduce issue

npm install --save-exact firebase@10.2 => autocomplete from types are available npm install --save-exact firebase@10.3 => autocomplete from types are not available

hsubox76 commented 2 days ago

That's really odd, the only change in Auth I see between 10.2 and 10.3 is a change for React Native users: https://github.com/firebase/firebase-js-sdk/pull/7570

Are you using React Native? If so, check out this comment (and the surrounding issue) and see if it's related to what you're experiencing: https://github.com/firebase/firebase-js-sdk/issues/7584#issuecomment-1692160552 In this issue, it only affects the VSCode editor autocomplete. It doesn't affect the actual build. Is that what you're seeing?

If you're not using React Native: Can you provide a minimal repro? I'd like to find out which path your project follows to try to find the typings. Ideally I would like to see the full structure and build tooling of your project (vite config, monorepo setup, etc), but I don't need to see any of your code except maybe a single line where you try to import types.