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

typescript minimum version not indicated by peer dependency #8837

Open
brantgurga opened this issue Mar 9, 2025 · 4 comments
Open

typescript minimum version not indicated by peer dependency #8837

brantgurga opened this issue Mar 9, 2025 · 4 comments

Comments

@brantgurga
Copy link
Contributor

Operating System

Linux

Environment (if applicable)

Typescript

Firebase SDK Version

11.4.0

Firebase SDK Product(s)

Installations

Project Tooling

React app via React-scripts (Create React App)

Detailed Problem Description

Updated to latest firebase dependency and the typescript compile failed for firebase having type modifiers on import names. So the current version requires typescript to be at least 4.5 to support that, but it's not indicated by the package.json dependencies.

Steps and code to reproduce issue

Use typescript before 4.5 and see a typescript compile fail on the syntaxes like import {type MyType} from 'firebase'

@brantgurga brantgurga added new A new issue that hasn't be categoirzed as question, bug or feature request question labels Mar 9, 2025
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@jbalidiong jbalidiong added api: core Repro Needed needs-attention and removed needs-triage new A new issue that hasn't be categoirzed as question, bug or feature request labels Mar 10, 2025
@DellaBitta DellaBitta added bug and removed question labels Mar 11, 2025
@jbalidiong
Copy link
Contributor

Hi @brantgurga, thanks for the report! I was able to reproduce the behavior on my end. I’ll investigate further to see what we can do to resolve this or loop in someone who can provide more context. I’ll keep this thread updated as soon as I have more details.

@dlarocque
Copy link
Contributor

Hi @brantgurga, thanks for reporting this issue! Since this SDK is designed for use by both TS and JS users, we can't add a peer dependency for TS. We are looking into alternatives that will allow us to support JS, while enforcing a minimum TS version- we'll keep you updated!

@brantgurga
Copy link
Contributor Author

@dlarocque I was wondering about that. I think peer dependency is the right way in the dependency model, but npm has changed its peer dependency handling at times, sometimes auto-installing peer dependencies and other times just warning that they aren't there or are unsatisfied. Looks like peerDependency to give the appropriate minimum typescript version would do it along with a peerDependencyMeta that marks typescript as optional so it doesn't automatically install. Or at least so conveys the current package.json documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants