将NextJs部署到firebase时出现内部服务器错误

时间:2017-09-16 11:46:47

标签: firebase firebase-hosting nextjs

我已将我的NextJS项目(改编自https://github.com/zeit/next.js/tree/master/examples/with-firebase-hosting)部署到firebase,但当我浏览到URL时,我得到了内部服务器错误"。

部署确实成功完成:

i  deploying database, functions, hosting
+  database: rules ready to deploy.
i  functions: ensuring necessary APIs are enabled...
i  runtimeconfig: ensuring necessary APIs are enabled...
+  runtimeconfig: all necessary APIs are enabled
+  functions: all necessary APIs are enabled
i  functions: preparing src/functions directory for uploading...
i  functions: packaged src/functions (571.83 KB) for uploading
+  functions: src/functions folder uploaded successfully
i  hosting: preparing src/public directory for upload...
!  Warning: Public directory does not contain index.html

i  Progress: [....................................................................................................]

+  hosting: 3 files uploaded successfully
i  starting release process (may take several minutes)...
i  functions: updating function next...
+  functions[next]: Successful update operation.
+  functions: all functions deployed successfully!

+  Deploy complete!

所以我觉得这可能与我的项目结构有关?还是firebase.json配置?有人可以看看,让我知道吗?

这是我的firebase.json,它位于我项目的根目录中:

{
  "database": {
    "rules": "database.rules.json"
  },
  "functions": {
    "source": "src/functions"
  },
  "hosting": {
    "public": "src/public",
    "rewrites": [
      {
        "source": "**/**",
        "function": "next"
      }
    ],
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

0 个答案:

没有答案