我将 Nextjs 13 网站部署到 Firebase 托管,链接预取和图像都不起作用。他们收到 503 服务不可用。我必须多次重新加载页面才能开始显示图像,但它们太慢了。
当我运行 npm run build 和 npm run start 时,一切正常。我错过了什么?
我正在使用: Firebase 工具:12.5.4
下一篇:^19.4.13 火力基地”:^10.4.0 firebase 管理员:^11.10.1
我最终通过增加NextJs部署的ssr函数使用的内存量解决了这个问题。好像整个网站都是这个功能。以下是为此函数添加更多内存的方法: 在 firebase.json 添加以下内容:
"hosting": {
"source": "directory that has your Next js",
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"frameworksBackend": {
"region": "us-west1",
"minInstances": 0, <------- you can configure these too
"maxInstances": 100, <------ and this one
"memory": "1GiB" <------- this line will increase the memory
}
},