简体   繁体   English

AWS Amplify 白屏问题

[英]AWS Amplify White Screen Issue

i have followed various links etc. i am able to publish to aws amplify but i get a white screen.我点击了各种链接等。我可以发布到 aws amplify,但我得到一个白屏。

i am using vss, github and amplify.我正在使用 vss,github 和放大。

i wrote the code我写了代码

then然后

npm run build -g npm 运行构建-g

git commit --all -m phil git 提交 --all -m phil

git push git 推送

this is just the basic react app.这只是基本的 React 应用程序。

i get the following when i inspect the page我在检查页面时得到以下信息

GET https://main.d3k27zedi0496.amplifyapp.com/static/js/main.a7eadf0b.js .net::ERR_ABORTED 403获取https://main.d3k27zedi0496.amplifyapp.com/static/js/main.a7eadf0b.js .net::ERR_ABORTED 403

any help greatly appreciated非常感谢任何帮助

heres my asset-manifest.json on my build directory这是我的构建目录中的 asset-manifest.json

{
  "files": {
    "main.css": "/static/css/main.073c9b0a.css",
    "main.js": "/static/js/main.a7eadf0b.js",
    "static/js/496.d68808b8.chunk.js": "/static/js/496.d68808b8.chunk.js",
    "static/media/logo.svg": "/static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg",
    "index.html": "/index.html",
    "main.073c9b0a.css.map": "/static/css/main.073c9b0a.css.map",
    "main.a7eadf0b.js.map": "/static/js/main.a7eadf0b.js.map",
    "496.d68808b8.chunk.js.map": "/static/js/496.d68808b8.chunk.js.map"
     },
    "entrypoints": [

"static/css/main.073c9b0a.css", "static/js/main.a7eadf0b.js" ] }``

` `

heres my app.js这是我的 app.js

    import logo from "./logo.svg";
    import "./App.css";

` function App() { return ( ` function App() { 返回 (

building Application建筑应用

); ); } }

export default App;导出默认应用程序;

heres my package.json (i have had it with and without the homepage line)这是我的 package.json(我有和没有主页行)

 `{ "name": "workflow", "version": "0.1.0", "private": true, "homepage": "https://main.d3k27zedi0496.amplifyapp.com", "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.4.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", "reactstrap": "^9.1.5", "web-vitals": "^3.1.1" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }``

this is my gitignore file这是我的 gitignore 文件

` # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. ` # 有关忽略文件的更多信息,请参见https://help.github.com/articles/ignoring-files/

 # dependencies /node_modules /.pnp.pnp.js # testing /coverage # production /build # misc.DS_Store.env.local.env.development.local.env.test.local.env.production.local npm-debug.log* yarn-debug.log* yarn-error.log* #amplify-do-not-edit-begin amplify/\#current-cloud-backend amplify/.config/local-* amplify/logs amplify/mock-data amplify/mock-api-resources amplify/backend/amplify-meta.json amplify/backend/.temp build/ dist/ node_modules/ aws-exports.js awsconfiguration.json amplifyconfiguration.json amplifyconfiguration.dart amplify-build-config.json amplify-gradle-config.json amplifytools.xcconfig.secret-* **.sample #amplify-do-not-edit-end

` `

I had a similar issue today and I resolved it by completely removing: "homepage": "{URL}" from my package.json and after that I got a strange access denied anytime I tried to navigate to my other pages and found that this solution in case 3 helped.我今天遇到了类似的问题,我通过从我的package.json中完全删除“homepage”:“{URL}”解决了这个问题,之后我在尝试导航到我的其他页面时遇到了一个奇怪的访问被拒绝的问题,并发现这个解决方案在案例 3 有所帮助。

I hope this helps you.我希望这可以帮助你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM