We are using AWS Amplify to host our web app, we generate our own PDF, then take the generated PDF and use WebViewer in order for the user to be able to edit if they would like to. Re-upload it to an S3 bucket. Works perfectly fine in a development environment but whenever we deploy to the production environment it will give us a 404 error signaling that there is no file to be found in order to properly view the PDF.
Please provide a link to a minimal sample where the issue is reproducible:
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
It seems like you’re encountering a 404 error in your production environment, which typically indicates that the application is trying to load a resource that doesn’t exist at the specified URL. This issue can often arise due to differences in how paths are handled between development and production environments or due to misconfigurations in file paths when deploying.
Some things you can try:
Ensure that all necessary files (e.g., CSS, JS) are correctly included in your build output and are being deployed to the correct location in your production environment.
Check your build configuration to verify that paths are correctly set for production. Sometimes, relative paths work in development but not in production.
Examine the network tab in your browser’s developer tools to see exactly which files are failing to load and from where.
Ensure that AWS Amplify is correctly configured to serve static files. You might need to adjust rewrite rules or other settings.
Verify that all assets are correctly uploaded to your S3 bucket and that permissions are set to allow access.