Error: could not handle the request

Error: could not handle the request

我正在学习 https://dialogflow.com/docs/getting-started/basic-fulfillment-conversation#deploy_function_again 上的教程并执行了 gcloud beta functions deploy weatherWebhook --trigger-http。 Google的回复似乎成功了:

Deploying function (may take a while - up to 2 minutes)...done.

availableMemoryMb: 256 entryPoint: weatherWebhook httpsTrigger:

url: https://[..].cloudfunctions.net/weatherWebhook

labels: deployment-tool: cli-gcloud

name: projects/[..]/functions/weatherWebhook

serviceAccountEmail: [..]@appspot.gserviceaccount.com

sourceUploadUrl: https://storage.googleapis.com/gcf-[..]

&Expires=1519141082&Signature=[..] status: ACTIVE timeout: 60s

updateTime: '2018-02-20T15:08:02Z' versionId: '3'

然而,当我在浏览器中打开 URL 时,我收到以下错误消息:

Error: could not handle the request

我错过了什么吗?我该如何解决这个问题?

事实证明,dialogflow.com 的教程已损坏。我必须设置一个 Node.js 服务器和所有东西,以便找出没有帮助的原因。错误消息 不是 从 Google 云转发的。很遗憾,我不推荐使用这两种服务。

C:\Node.js\run-func:2
basedir=$(dirname "$(echo "[=10=]" | sed -e 's,\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:607:28)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

如果有人遇到类似问题,这里有一些故障排除建议:

  • 检查浏览器开发者工具中的网络面板; dialogflow 网站返回 HTTP 400 错误,这些错误在第二天使用完全相同的代码消失了(他们的网站 标记为测试版)。
  • 确保您上传的文件正确(我仍然值得一提)。
  • 如果服务器默认返回错误,则假定您(或任何人)的代码在本地 工作。我努力验证来自 dialogflow 的代码,然后 将联系任一服务。