【发布时间】:2021-12-28 03:21:50
【问题描述】:
我浏览了文档,但无法让 UI firebase 模拟器工作。
我在 mac M1 上使用 firebase 版本:9.22.0
控制台警告。
i emulators: Starting emulators: hosting
i hosting: Serving hosting files from: build
✔ hosting: Local server: http://localhost:5001
⚠ emulators: The Emulator UI requires a project ID to start. Configure your default project with 'firebase use' or pass the --project flag.
┌─────────────────────────────────────────────────────────────┐
│ ✔ All emulators ready! It is now safe to connect your app. │
└─────────────────────────────────────────────────────────────┘
┌──────────┬────────────────┐
│ Emulator │ Host:Port │
├──────────┼────────────────┤
│ Hosting │ localhost:5001 │
└──────────┴────────────────┘
Emulator Hub running at localhost:4400
Other reserved ports: None
我已尝试使用 --project myproject ,但仍然无法正常工作。
Firebase.json
{
"hosting": {
"public": "build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
"emulators": {
"hosting": {
"port": 5001
},
"ui": {
"enabled": true,
"host": "localhost",
"port": 4000
}
}
}
我已确保我的模拟器已设置:
firebase init emulators
谁能帮帮我,这让我发疯了。
【问题讨论】: