简体   繁体   中英

Site not deployed on AWS S3

I have followed all instructions of deploying React app to AWS S3. Uploaded all files and folders in bucket, but, when clicked on site endpoint in Static Website Hosting shows blank page.What may be the cause? Please see following images for reference

All files and folders uploaded在此处输入图片说明 Static Website Hosting in properties also updated在此处输入图片说明 Public access also enabled在此处输入图片说明 Bucket Policy also updated在此处输入图片说明 Blank Page在此处输入图片说明

This is all required for React App to deploy on AWS S3. Any suggestions?

Fetching index.html works fine, but the various JavaScript files are all yielding 404.

The problem appears to be that your HTML is fetching resources as:

/WeatherApp/static/js/main.057efd26.chunk.js

but in the origin they are actually at:

/static/js/main.057efd26.chunk.js

Fix your index.html to refer to static resources rooted at /static/ , not /WeatherApp/static/ .

  1. In package.json file, change homepage to: "homepage": "./"
  2. npm run build
  3. re-upload these build files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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