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.

已提問 2 年前檢視次數 315 次
1 個回答
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
支援工程師
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南