【发布时间】:2018-06-26 23:11:19
【问题描述】:
我创建了一个具有功能的简单动态 Firebase 托管,部署时一切正常,但在本地提供页面时却不行。
这是firebase serve的日志
i functions: Preparing to emulate functions.
i hosting: Serving hosting files from: public
✔ hosting: Local server: http://localhost:5004
✔ functions: serveLandingPage: http://localhost:5001/zonaskripsi18/us-central1/serveLandingPage
正如我们所见,控制台和firebase-debug.log 中都没有错误日志,但是当我打开http://localhost:5004 时它显示An internal error occurred while connecting to Cloud Function "serveLandingPage"
这是firebase.json
{
"firestore": {
"rules": "firestore.rules",
"indexes": "firestore.indexes.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
},
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "/**",
"function": "serveLandingPage"
}
]
}
}
【问题讨论】:
-
请使用 firebase.json 中的配置编辑问题。
-
嗨史蒂文森,我已经添加了 firebase.json 的内容
-
查看您的云功能日志。它可能取决于仅服务器的配置/功能。
标签: firebase firebase-hosting firebase-cli