【发布时间】:2019-04-29 22:40:33
【问题描述】:
我为我在 google 项目上的操作创建了一个 Google 登录,我想将帐户信息保存到 firestore 数据库。
我查看了 Google 的示例(示例 here,位于标题“处理数据访问请求”的最底部),但是当您实际尝试将其部署到 firebase 时,你意识到它实际上有无效的语法(或者至少那是对话流内联编辑器所说的......)
这是我尝试部署此代码时的具体错误说明:
The deployment of your Cloud Function failed:
Function load error: Code in file index.js can't be loaded.
Is there a syntax error in your code?
Detailed stack trace: /user_code/index.js:34
app.intent('Get Sign In', async (conv, params, signin) => {
^
SyntaxError: Unexpected token (
有什么建议吗?
感谢您的帮助!
请注意:我只使用教程对 PLUS 说的代码 我在谷歌图书馆和履行行添加了行动(即:
// Other libraries...
const {
dialogflow,
BasicCard,
Permission,
Suggestions,
Carousel,
SignIn
} = require('actions-on-google');
// ** code from tutorial / link **
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)
【问题讨论】:
-
您要部署的节点的 Firebase 配置/版本是什么。我想知道您是否正在部署到 JavaScript 没有但 TypeScript 确实有
async/await的 Node 6,请参阅:Cloud Functions for Firebase Async Await style -
我正在运行/正在运行 Node 6,我解决了问题并将在下面发布。
标签: javascript node.js firebase dialogflow-es actions-on-google