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

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

Closed
Temez1 opened this issue Oct 1, 2021 · 3 comments · Fixed by #5570
Closed

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

Temez1 opened this issue Oct 1, 2021 · 3 comments · Fixed by #5570

Comments

@Temez1
Copy link

Temez1 commented Oct 1, 2021

Environment

  • Firebase SDK version: 9.1.1
  • Reactfire version: 4.2.0

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"]
}
@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.

@hsubox76
Copy link
Contributor

hsubox76 commented Oct 1, 2021

Thanks, I will look into fixing the typings errors.

In the meantime, so that you are unblocked, can I ask how you are importing Firebase? When directly using Firebase, there shouldn't be any app check code in the bundle if you didn't import app check, and you only imported auth, but I don't know if Reactfire does anything different.

@Temez1
Copy link
Author

Temez1 commented Oct 1, 2021

Asked reactifire to give their input. I guess the TS compiler checks the whole firebase library even if I'm not importing all of the modules.

When I changed skipLibCheck: true it compiles fine (because it doesn't check the lib). But I prefer to keep it on so I will continue to check my dependencies for cases like this.

@firebase firebase locked and limited conversation to collaborators Nov 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants