-
[오류 해결] serviceAccount is not assignable to parameter of type 'string | ServiceAccount'. | firebase cloud functions프로그래밍/흔적 2022. 8. 10. 20:34
소스 코드
admin.initializeApp({ credential: admin.credential.cert(serviceAccount), });
오류 메시지
import serviceAccount
Argument of type '{ type: string; project_id: string; private_key_id: string; private_key: string; client_email: string; client_id: string; auth_uri: string; token_uri: string; auth_provider_x509_cert_url: string; client_x509_cert_url: string; }' is not assignable to parameter of type 'string | ServiceAccount'.ts(2345)해결 방법
import admin, {ServiceAccount} from "firebase-admin"; admin.initializeApp({ credential: admin.credential.cert(<ServiceAccount>serviceAccount), });
참고 자료
firebase import service throws error
I'm using firebase functions and I want to initializeApp with service account key json into credential and I get the error Argument of type '{ "type": string; "project_id": string; "private_key_...
stackoverflow.com
질문이나 오류 발견 환영입니다.
'프로그래밍 > 흔적' 카테고리의 다른 글
firebase AppCheck 설정 in web ( with NextJS ) | localhost에서 사용 (debug mode) (0) 2022.11.21 [GA4] SPA 페이지뷰 설정 - 향상된 측정 | react, nextjs, google analytics (0) 2022.08.29 firebase cloud functions 설치, 설정 with typescript | cors (0) 2022.08.11 codeload github 주소 의미 해석 (0) 2022.08.09 [React MUI] - 1분만에 nextjs, material ui, typescript 설치 및 사용하기 (0) 2022.07.28