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] Initialize types too strict #624

Closed
TheDuc opened this issue Aug 16, 2019 · 2 comments
Closed

[TypeScript] Initialize types too strict #624

TheDuc opened this issue Aug 16, 2019 · 2 comments

Comments

@TheDuc
Copy link

TheDuc commented Aug 16, 2019

Describe your environment

  • Firebase SDK version: 8.3.0
  • Firebase Product: firebase admin
  • Node.js version: 10.16.0
  • NPM version: 6.10.3

Describe the problem

When initialising firebase admin with standard downloaded service account json, typescript error incompatible types when "resolveJsonModule": true, in compiler

Relevant Code:

import * as admin from 'firebase-admin';

import * as serviceAccount from "path/to/serviceAccountKey.json";

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),     // <---- type error here
  databaseURL: "https://<DATABASE>.firebaseio.com"
});

tsconfig.json

"compilerOptions": {
    (...),
    "resolveJsonModule": true,
  },
@google-oss-bot
Copy link

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

@hiranya911
Copy link
Contributor

Duplicate of #522. See the explanations and workarounds discussed there.

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