0

I deployed a react js application to s3, and put behind AWS application load balancer. My react app is using template create by create-react-app library, build using command react-scripts build

I set the rule as if any request to /react-app* to render my application,

It is able to load index page, however, all js, and assets cannot be loaded due to ReactJS inject js script when it build as static resource,

What ReactJS build output:

<script src="/static/js/10.d87ac982.chunk.js"></script>

But I want this

<script src="/react-app/static/js/10.d87ac982.chunk.js"></script>
7
  • 1
    Possible duplicate stackoverflow.com/questions/37396427/… Note that this is entirely an issue with the way you are bundling the React app. There is nothing AWS specific about the issue. Commented Sep 28, 2021 at 17:30
  • 1
    Depends how you are bundling the project - custom, CRA, NetxJS etc, please provide more info as the question currently can't be answered Commented Sep 28, 2021 at 17:34
  • @Dominic My react app is using template create by create-react-app library, build using command react-scripts build Commented Sep 29, 2021 at 3:42
  • @MarkB You can say it is not related, but I want to specify it as AWS due to the load balancer is serverless service which is not managed me, and I build react-js app and save to S3 as static website. And the question you mention, it is a bit different because I don't do any routing, and I don't any webpack Commented Sep 29, 2021 at 3:49
  • 1
    @VengleabSO check this stackoverflow.com/questions/49429906/… Commented Sep 29, 2021 at 13:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.