Hata: Firebase https çağrılabilir bulut işlevleri çağrılırken yeni HttpsErrorImpl'de dahili [duplicate]

Oct 06 2020

Bu, https çağrılabilir bulut işlevini çağıran manageSubscription () öğesini her çağırdığımda aldığım hatadır:

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)

Kullanarak:

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

İşte Uygulamalar Modülüm:

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

Hizmetimde https çağrılabilir bulut işlevini çalıştırıyorum:

Bağımlılık eklendi:

constructor(private firebaseFunctions: AngularFireFunctions) {}

Yöntem budur:

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

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

Bu, bulut işlevidir:

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 };
});

Bu işleve yapılan çağrıları bulut işlevi günlüklerinde veya chrome dev console Network sekmesinde göremiyorum. Neyi yanlış yapıyorum?

Hem bulut işlevleri emülatörünü hem de canlı uygulamayı denedim. Hala şans yok!

Son 3 günden beri bu hatayı gidermeye çalışıyorum ve biraz saç ve kilo kaybettim: /

Yanıtlar

4 MartinU Oct 06 2020 at 08:16

Bu sorundan dolayı saçını kaybeden tek kişi siz değilsiniz. Basitçe istemcideki firebase paketini güncelleyerek çözdüm (Cuma günü de aynı şeyi yaptım ama henüz çözülmedi) 7.22.0 sürümü şeytan tarafından kodlandı, 7.22.1'e yükseltin ve umarım ince.