GCloud:调试“功能崩溃到请求范围之外” [英] GCloud: Debug "function crashed out of request scope"

查看:101
本文介绍了GCloud:调试“功能崩溃到请求范围之外”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 GCloud 功能,该功能似乎崩溃 静默,没有任何错误

I'm running a GCloud function, which seems to crash silently, without any kind of error trace.

一切都可以在模拟器中完美运行,但是在 GCloud 上运行时会崩溃!

Everything works perfectly in the emulator but crashes when running on GCloud!

函数的日志中显示以下消息:

The following message shows up in the function's logs:

错误:函数崩溃超出了请求范围函数被杀死。

关于如何调试它的任何想法?

Any idea on how to debug this?

推荐答案

我认为此问题与返回的内容以及返回的方式有关。在生产环境中,如果您未正确返回诺言,则由于您假定工作已完成,因此您的函数将被终止。在本地,这可能不会发生,因此该错误是不可见的。请看这里的示例: https://github.com/firebase/functions-samples / issues / 78

I think this issue has to do with what you are returning, and how you returning it. In the production environment, if you do not properly return a promise your function will be killed since it assumes your work is done. locally, that will probably not happen so the bug is invisible. Look here, for an example: https://github.com/firebase/functions-samples/issues/78

这篇关于GCloud:调试“功能崩溃到请求范围之外”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆