【问题标题】:Redirect error while deploying nuxt app with aws amplify使用 aws amplify 部署 nuxt 应用程序时出现重定向错误
【发布时间】:2020-10-03 14:57:21
【问题描述】:

当我尝试部署应用程序时,构建完成且没有错误。当我转到提供的链接 (https://master.d3m2wky0hslwhr.amplifyapp.com/) 时,我得到 ERR_TOO_MANY_REDIRECTS 。

我的构建配置:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    # IMPORTANT - Please verify your build output directory
    baseDirectory: .nuxt
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

在我拥有的应用程序中(index.vue、login.vue 和 register.vue)

我认为这可能是因为我被重定向到 url/index.html 并且该文件在项目中不存在。

【问题讨论】:

    标签: amazon-web-services nuxt.js aws-amplify


    【解决方案1】:

    解决了。

    将 -npm run build 更改为 -npm run generate (这会默认创建 index.html 并将所有内容转换为静态) 将 baseDirectory 更改为 dist

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-17
      • 2021-06-10
      • 2016-11-14
      • 2022-10-01
      • 2019-08-07
      • 2013-01-18
      • 2016-04-22
      • 2018-11-23
      相关资源
      最近更新 更多