Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 views
in Technique[技术] by (71.8m points)

reactjs - Serving React App from S3 Bucket returns "You need to enable javascript to run this app"

Strange problem I faced today with deploying my react app (built by amplify) to S3Bucket Everything worked fine for the past year and half, nothing changed except for a new computer and new npm/react/amplify installations, etc.

Copying my build to S3, the site will fail, the browser will download a file that has the following

"You need to enable JavaScript to run this app."

Here is what I tried

  • Reviewed all settings, all content types, etc. (nothing changed except the files)

  • Added a test text.html, that worked flawlessly

  • Ran "serve -s build" locally to confirm build was working

  • The only thing that works was to open my 'index.html' in my build directory and removed the following line

    You need to enable JavaScript to run this app.

That seems to have fixed the problem!

Short of me modifying index.html every time after I run my build (which breaks my pipeline), any ideas what happened here? has anyone faced such a problem lately?

It seems to be localized to S3 bucket deployment

Extra Info I use Amplify to handle my GraphQL, backends, etc. I use classic Cloud-Front in front of an S3 bucket with aws cli to copy files to the S3 bucket in a shell script that again has been working fine for the past 18 months!

question from:https://stackoverflow.com/questions/65891048/serving-react-app-from-s3-bucket-returns-you-need-to-enable-javascript-to-run-t

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...