Skip to content

fix(app-check): remove ReactNativeFirebaseAppCheckProvider from type-only export#8871

Closed
kimchi-developer wants to merge 1 commit intoinvertase:mainfrom
kimchi-developer:fix/app-check-provider-export
Closed

fix(app-check): remove ReactNativeFirebaseAppCheckProvider from type-only export#8871
kimchi-developer wants to merge 1 commit intoinvertase:mainfrom
kimchi-developer:fix/app-check-provider-export

Conversation

@kimchi-developer
Copy link

@kimchi-developer kimchi-developer commented Feb 2, 2026

Problem

When importing ReactNativeFirebaseAppCheckProvider as documented:

import { ReactNativeFirebaseAppCheckProvider } from '@react-native-firebase/app-check';

const provider = new ReactNativeFirebaseAppCheckProvider(); // ❌ TS2693

TypeScript throws:

'ReactNativeFirebaseAppCheckProvider' only refers to a type, but is being used as a value here. (TS2693)

Note: This is a different issue from #8512 (TS2614: "has no exported member"), which was fixed by #8529. That PR added the modular exports but kept ReactNativeFirebaseAppCheckProvider in the export type {} block, causing this new conflict.

Root Cause

In packages/app-check/lib/index.ts:

export type {
  // ...
  ReactNativeFirebaseAppCheckProvider,  // ← exported as TYPE
} from './types/appcheck';

export * from './modular';  // ← also exports as VALUE (class)

When the same name is exported as both a type (via export type) and a value (via export *), TypeScript prioritizes the type-only export, making it impossible to use as a constructor.

Solution

Remove ReactNativeFirebaseAppCheckProvider from the export type {} block.

The class will still be exported via export * from './modular', and type inference will work correctly.

Affected Versions

  • Tested on @react-native-firebase/app-check@23.8.5

…only export

ReactNativeFirebaseAppCheckProvider is exported as a class from ./modular,
but was also listed in the type-only export block.

When both exist, TypeScript prioritizes the type-only export, causing:
`'ReactNativeFirebaseAppCheckProvider' only refers to a type, but is being used as a value here.`

Removing it from `export type {}` allows the class export from `./modular` to take precedence.

Fixes invertase#8512
@vercel
Copy link

vercel bot commented Feb 2, 2026

@kimchi-developer is attempting to deploy a commit to the Invertase Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Hello 👋, this PR has been opened for more than 14 days with no activity on it.

If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing!

You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Feb 18, 2026
@mikehardy
Copy link
Collaborator

This will be superceded by #8889 - app-check types and docs have been problematic, no argument there, apologies for that and we should have them shaped up shortly so they match firebase-js-sdk much more closely and behave well with typescript

@mikehardy mikehardy closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants