Angular 错误:调用Firebase https可调用云函数时在新的HttpSerroImpl处出现内部错误
这是每次调用调用https可调用云函数的manageSubscription()时出现的错误:Angular 错误:调用Firebase https可调用云函数时在新的HttpSerroImpl处出现内部错误,angular,firebase,google-cloud-functions,angularfire,Angular,Firebase,Google Cloud Functions,Angularfire,这是每次调用调用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:1
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)
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 };
});
这是我的应用程序模块:
@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);
});
}
这是云功能:
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)
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开发控制台网络选项卡中看不到对此函数的调用。我做错了什么
我尝试了云功能模拟器和live应用程序。还是不走运
在过去的3天里,我一直在尝试调试这个问题,并且已经减掉了一些头发和体重://你不是唯一一个因为这个问题而掉头发的人。 我只需更新客户端中的firebase包就解决了这个问题(我在周五做了同样的事情,但还没有解决) 7.22.0版是由魔鬼编写的,升级到7.22.1你会没事的。1)你应该得到我所有的互联网积分。2) 没有关于这个问题的文件-你有我们的参考资料吗?在这里找到一些细节