簡體   English   中英

使用 aws amplify 部署 nuxt 應用程序時出現重定向錯誤

[英]Redirect error while deploying nuxt app with aws amplify

當我嘗試部署應用程序時,構建完成且沒有錯誤。 當我 go 到提供的鏈接時( 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 並且該文件在項目中不存在。

解決了。

將 -npm run build 更改為 -npm run generate (這會默認創建 index.html 並將所有內容轉換為靜態)將 baseDirectory 更改為 dist

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM