这是indexloc提供的服务,不要输入任何密码
Skip to content

Cannot find namespace 'firebase'.ts(2503) for with firebase/compat/app and "moduleResolution": "bundler" #7279

@segevfiner

Description

@segevfiner

[REQUIRED] Describe your environment

  • Operating System version: macOS 13.3.1 (a)
  • Browser version: Google Chrome 113.0.5672.63
  • Firebase SDK version: 9.21.0
  • Firebase Product: sdk (auth, database, storage, etc)

[REQUIRED] Describe the problem

With the new "moduleResolution": "bundler" mode of TypeScript 5.0+, TypeScript errors on attempting to access any type from the firebase global namespace with firebase/compat/app and friends imported. It works with "moduleResolution": "node".

Steps to reproduce:

  1. Clone https://github.com/segevfiner/firebase-types-issue
  2. pnpm i
  3. pnpm type-check.
  4. If you set "moduleResolution": "node" in tsconfig.app.json it will work, but it should work with the new moduleResolution mode as well.

Relevant Code:

https://github.com/segevfiner/firebase-types-issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions