我在> Firebase>托管>主(https://console.firebase.google.com/u/0/project/example/hosting/main)
中有两个Firebase托管站点1. **foobar**.web.app (default project from setup process)
2. **example**.web.app (added as an additional web app under the main project and linked for hosting)
这些是我的 .firebaserc 设置:
{
"targets": {
"foobar": {
"hosting": {
"foobar": [
"foobarWebApp"
]
}
},
"example": {
"hosting": {
"foobar": [
"foobarWebApp"
],
"example": [
"foobar"
]
}
}
},
"projects": {
"default": "foobar"
}
}
从 Firebase CLI 运行 firebase部署后,文件被部署到 foobar .web .app 。如何将其更改为 示例 .web.app ?
我尝试了firebase deploy --only hosting:example
,但总是返回错误:发生了意外错误。
答案 0 :(得分:1)
您是否正确设置了托管目标?
在您的CLI中,
firebase target:apply type target-name resource-name
hosting
。foobar
或example
为Firebase资源设置部署目标后,请在firebase.json
配置文件中引用已应用的目标名称。
请参见https://firebase.google.com/docs/cli/targets
编辑:
您的.firebaserc
应该看起来像这样(尽管运行上面的命令行语句应该已经为您改变了,而您需要更新的只是package.json
):
"projects": {
"default": "project-name"
},
"targets": {
"project-name": {
"hosting": {
"example": [ // target-name
"example-website" // resource-name
],
"foobar": [ // target-name
"foobar-website" // resource-name
]
}
}
}
答案 1 :(得分:1)
我认为可以将其分解为“确定性描述变量”
.firebaserc文件
{
"targets": {
"firebaseProjectID": {
"hosting": {
"targetValueInFirebase.json": [
"yourFirebaseHostingDomain"
]
}
}
},
"projects": {
"cli_alias": "firebaseProjectID"
}
}
答案 2 :(得分:0)
我遇到了同样的问题并通过这个解决了:
<Record y.name='d' n.value=None>
,
2.delete browser cache
,
3.reopen browser
4.run deploy again
*