【发布时间】:2020-12-29 22:05:46
【问题描述】:
以下是我的功能的相关位:
// Finally send the JSON data to the browser or requestor
res.status(200).send(output);
} catch (err) {
res.status(500).send(err.message);
} finally {
await closeConnection(page, browser);
}
当我在本地运行它时,它可以完美运行并将我的输出返回到网络浏览器。当我将其上传到 Google Cloud Functions 并对其进行测试时,res.status(200).send(output); 行失败并显示以下消息:
Error: function execution failed. Details:
res.status is not a function
还有其他人看到过这种行为吗?我完全不明白为什么它可以在我的本地机器上完美运行,但是当我将它作为云功能运行时却失败了。
【问题讨论】:
-
请编辑问题以显示重现此错误的complete minimal code。你现在所拥有的还不足以理解问题所在。
标签: node.js google-cloud-platform google-cloud-functions