FirebaseExtended / reactfire

Hooks, Context Providers, and Components that make it easy to interact with Firebase.
https://firebaseopensource.com/projects/firebaseextended/reactfire/
MIT License
3.52k stars 401 forks source link

App Check typing errors (incorrect implementations of interface) #466

Closed Temez1 closed 2 years ago

Temez1 commented 2 years ago

This is a copy of the issue in firebase/firebase-js-sdk#5569

to get your input to the discussion, see the question. I don't know if reactfire has something to do with this.

Environment

Problem

I'm trying to compile my project & it throws 2 errors

node_modules/@firebase/app-check/dist/app-check-public.d.ts:87:22 - error TS2420: Class 'CustomProvider' incorrectly implements interface 'AppCheckProvider'.
  Type 'CustomProvider' is missing the following properties from type 'AppCheckProvider': getToken, initialize

node_modules/@firebase/app-check/dist/app-check-public.d.ts:171:22 - error TS2420: Class 'ReCaptchaV3Provider' incorrectly implements interface 'AppCheckProvider'.
  Type 'ReCaptchaV3Provider' is missing the following properties from type 'AppCheckProvider': getToken, initialize

The source code has the following comments, but the compiler doesn't really care about those.

    /* Excluded from this release type: getToken */
    /* Excluded from this release type: initialize */
    /* Excluded from this release type: isEqual */

Steps to reproduce:

I started using firebase with Reactfire. I'm using just auth. I'm not using App Check.

Relevant Code:

TS config

{
  "compilerOptions": {
    "target": "ESNext",
    "useDefineForClassFields": true,
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "allowJs": false,
    "skipLibCheck": false,
    "esModuleInterop": false,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "ESNext",
    "moduleResolution": "Node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react-jsx",
    "types": ["vite/client"]
  },
  "include": ["./src"]
}
jhuleatt commented 2 years ago

A fix for the typing problems has been merged, https://github.com/firebase/firebase-js-sdk/issues/5569 and will be out in the next JS SDK release.