已将 Nextjs 网站部署到 Firebase 托管,但链接预取和图像收到 503 服务不可用

问题描述 投票:0回答:1

我将 Nextjs 13 网站部署到 Firebase 托管,链接预取和图像都不起作用。他们收到 503 服务不可用。我必须多次重新加载页面才能开始显示图像,但它们太慢了。

当我运行 npm run build 和 npm run start 时,一切正常。我错过了什么?

我正在使用: Firebase 工具:12.5.4

下一篇:^19.4.13 火力基地”:^10.4.0 firebase 管理员:^11.10.1

firebase-hosting next.js13
1个回答
0
投票

我最终通过增加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
    }
  },

© www.soinside.com 2019 - 2024. All rights reserved.