CSS styling is missing after hosting with AWS in Serverless mode.

0

Hello,

I have hosted a Remix JS application in serverless mode with S3 and Lamda functions. Deploying it into serverless using buildspec.yml and serverless.yml. The application hosted properly but CSS styling is missing, the application is trying to load the CSS from https://{domain_name}/_static/build/_assets/app-OAMDP42D.css, but it is getting a 404 response. I checked the s3 bucket, it has the CSS under the server/_assets/app-OAMDP42D.css path. But in AWS Lamda the server folder only has index.js. Can anyone help with how to enable the CSS styling with the S3 bucket and AWS LAMDA? Thanks in advance.

asked 2 years ago308 views
1 Answer
0

Hello,

Good day.

If the 404 error is from S3, it looks like Lambda is referring to an object that does not exist in the bucket. To check what exactly is being sent in the request or if there are any additional characters in the object name which could be causing the issue, we would have to look into the logs for the 404 response. For this, please feel free reach out to us via creating a support case from the support centre dashboard and share the S3 request ID pair with us. You can refer here for details on collecting the request ID pair.

I came across a few external articles (1,2) which discuss about keeping CSS in the S3 bucket and calling it via lambda function which may offer additional guidance.

Thank you.

AWS
SUPPORT ENGINEER
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions