[英]Failed to load resource: the server responded with a status of 400 :spring mvc
[英]Amplify makes `Failed to load resource: the server responded with a status of 400` error
我在使用 Amplify 時遇到了這個錯誤,我完成了構建。
Failed to load resource: the server responded with a status of 400
manifest.json:1
該系統可以在本地環境中工作。 本地環境的 Package.json 腳本是這個。
.......
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"format": "./node_modules/.bin/eslint --fix --ignore-path .gitignore ."
},
.......
我的 amplify.xml 在下面。
version: 1
frontend:
phases:
preBuild:
commands:
- nvm install 14.15.0
- nvm use 14.15.0
- yarn install
build:
commands:
- nvm install 14.15.0
- nvm use 14.15.0
- node -v
- yarn run build
artifacts:
baseDirectory: public
files:
- '**/*'
cache:
paths:
- 'node_modules/**/*'
屏幕完全空白。
有沒有人有同樣的煩惱?
我遇到了同樣的問題,經過數小時的故障排除后,結果證明這是一個 Amplify CI/CD 構建配置問題。
將存儲庫連接到 Amplify 應用程序時,系統會提示您編輯 amplify.yaml 文件中的構建設置。 無論出於何種原因, baseDirectory
的默認值設置為public
。
下載文件,將其放在存儲庫根目錄中,然后更改:
artifacts:
baseDirectory: public
至
artifacts:
baseDirectory: build
提交、推送、重新連接分支,它應該可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.