오류 : Firebase https 호출 가능 클라우드 함수를 호출 할 때 새 HttpsErrorImpl 내부에 있음 [duplicate]

Oct 06 2020

이것은 https 호출 가능 클라우드 함수를 호출하는 manageSubscription ()을 호출 할 때마다 발생하는 오류입니다.

core.js:4081 ERROR Error: internal
    at new HttpsErrorImpl (index.cjs.js:60)
    at _errorForResponse (index.cjs.js:155)
    at Service.<anonymous> (index.cjs.js:560)
    at step (tslib.es6.js:100)
    at Object.next (tslib.es6.js:81)
    at fulfilled (tslib.es6.js:71)
    at ZoneDelegate.invoke (zone-evergreen.js:364)
    at Object.onInvoke (core.js:27149)
    at ZoneDelegate.invoke (zone-evergreen.js:363)
    at Zone.run (zone-evergreen.js:123)

사용 :

"@angular/core": "^10.0.4",
"@angular/fire": "^6.0.3",

내 앱 모듈은 다음과 같습니다.

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    AngularFireModule.initializeApp(environment.firebaseConfig),
    AngularFireFunctionsModule,
    SharedComponentsModule,
    AppRoutingModule
  ],
  providers: [
    { provide: ORIGIN, useValue: 'http://localhost:5001' }
  ],
  bootstrap: [AppComponent]
})

내 서비스에서 https 호출 가능 클라우드 기능을 호출하고 있습니다.

추가 된 종속성 :

constructor(private firebaseFunctions: AngularFireFunctions) {}

방법은 다음과 같습니다.

public manageSubscription(){
  this.firebaseFunctions.useFunctionsEmulator('http://localhost:5001');

  const functionRef = this.firebaseFunctions.httpsCallable('testFunction');
  functionRef({ returnUrl: 'window.location.origin' })
    .subscribe(response => {
      console.log(response);
  });
}

이것은 클라우드 기능입니다.

import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin';

admin.initializeApp();

exports.testFunction = functions.https.onCall((data, context) => {
    console.log('reached');
  return { date: true };
});

클라우드 기능 로그 또는 Chrome 개발 콘솔 네트워크 탭에서이 기능에 대한 호출을 볼 수 없습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

클라우드 기능 에뮬레이터와 라이브 앱을 모두 사용해 보았습니다. 여전히 운이 없습니다!

나는 지난 3 일 이후로 이것을 디버깅하려고 노력해 왔으며 약간의 머리카락과 체중을 잃었습니다.

답변

4 MartinU Oct 06 2020 at 08:16

이 문제로 머리카락을 잃은 사람은 당신뿐이 아닙니다. 나는 간단하게 업데이트하여 해결 중포 기지 클라이언트에 패키지를 (I 금요일에 같은 일을했지만 아직 해결되지 않은) 7.22.1로 업그레이드, 7.22.0 악마에 의해 코딩 된 버전을 당신은 희망이있을거야 좋아.