当我尝试启动模拟器时,我一直面临着这个 firebase 模拟器错误,并且它通过连续提供此错误而突然停止:
无法从源加载函数定义:无法从函数源生成清单:语法错误:意外的标记“.”
我尝试了许多不同的过程,但找不到任何可能的解决方案来解决这个问题。我更新了 firebase-function 版本,因为他们中的许多人都提供了该解决方案,但这对我不起作用。
我的 firebase.json 文件:
{
"hosting": {
"predeploy": ["npm run --prefix client build"],
"public": "client/out",
"cleanUrls": true,
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"rewrites": [
{
"source": "/app/**",
"function": "app"
},
{
"source": "/meeting/*",
"destination": "/meeting.html"
},
{
"source": "/meeting",
"destination": "/404.html"
}
]
},
"functions": {
"source": "functions"
},
"firestore": {
"indexes": "firestore.indexes.json"
},
"emulators": {
"functions": {
"port": 3002
},
"firestore": {
"port": 3001
},
"ui": {
"enabled": true
}
}
}Run Code Online (Sandbox Code Playgroud)
函数的package.json文件: