【发布时间】:2021-02-17 20:34:52
【问题描述】:
我一直在尝试将 nuxt SSR 应用程序部署到 AWS Amplify。 我的目录结构是这样的
my-nuxt-app
|-.nuxt(contains view, dist etc.)
|-assets
|-components
|-layouts
|-pages
|-plugins
|-static
|-store
|-.gitignore
|-nuxt.config.js
|-package.json
|-package-lock.json
|-secrets.json(has my env configs)
我要做的是将 my-nuxt-app 文件夹作为 git 存储库进行管理,并通过 AWS Amplify 部署该存储库。我一直在寻找将应用程序部署到 AWS 的方法,并且似乎没有人在完整的演练中真正描述过。
到目前为止我做了什么:
我试过放大.yml
到
baseDirectory: dist
就像大多数说明所说的那样。
得到'dist' not found
我试过放大.yml
到
baseDirectory: .nuxt/dist
得到
2020-11-05T06:00:05.617Z [ERROR]: !!! Build failed 2020-11-05T06:00:05.617Z [ERROR]: !!! Non-Zero Exit Code detected
我尝试更改 buildDir 并使其成为单独的 git 存储库。 (将 package.json 手动复制到文件夹中) 它构建良好并已确认,但 URL 将显示 502 错误页面
The Lambda function result failed validation: The function tried to add, delete, or change a read-only header. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
我不知道我缺少什么,以及我应该如何使用 git 正确管理 nuxt 项目。
【问题讨论】:
-
我认为这篇文章描述了如何部署静态 nuxt spa 应用来放大。不是ssr?
-
Amplify 上的 SSR 似乎很新。我还没有弄清楚如何让它也能正常工作,但我正在与 AWS 支持部门合作,希望能得到关于如何做到这一点的答案
标签: amazon-web-services vue.js nuxt.js aws-amplify