-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Homepage of React App Hosted on Amplify Returns a Blank Page Occasionally #3026
Comments
Hi @aaronlee232 👋🏽 we are investigating this error and will report with an update shortly. |
Facing same issue with nextjs SSR . Occasionally rendering blank page on fast redirections. No errors getting logged in cloudwatch as well |
did you guys got any answer to it |
I ended up switching to using s3 buckets to host the site. I still had issues with the blank page, but I think I managed to fix it. I think the error was a combination of missing css files and the trying to access a dom element that hasn't been mounted yet. I fixed the css errors by explicitly adding the missing css files into the build directory in a github actions workflow step. as for the DOM error, this line was my problem:
The top menu element wasn't rendered in the dom yet, so I was essentially trying to access the classList of a null type. I found a solution online which was to write an async version of getElementById
and change my original code to this
|
We had to switch to Vercel. Much faster and no blank issues coming their. |
yes. |
@aaronlee232 the CSS files are not part of the build artifacts but they are referenced in your index.html. Can you please run the build locally and make sure those files generated in the build output. The 404 issue no longer repro. This could be related to client side transient network issues. Please create a new Issue if you are still seeing the error. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
This issue has been automatically locked. |
Before opening, please confirm:
App Id
d2so3m8bcmxfn4
Region
us-east-1
Amplify Hosting feature
No response
Describe the bug
I created a React App with route.js and hosted it using the GitHub option for Amplify.
Refreshing the homepage or loading the homepage will result in a blank page occasionally. Sometimes, the page renders correctly and other times it just appears as a blank white page.
This seems to only be occurring on the homepage.
The following errors appear when the website returns a blank page:
Two other errors are generated by the console, but they seem to appear regardless of whether the website renders properly or not (not sure if these are relevant):
Image of blank page:
Expected behavior
The website should be able to get the css resources and not be rendering a blank white page.
Properly rendered site:
Reproduction steps
OR
Build Settings
Additional information
None of these errors or blank page occur when doing a local host in the production build folder of the react project.
Several threads online suggested adding a rewrite for the index.html page, but that didn't work for me:
Tried switching to manual builds and used the compressed build folder. Same issue.
The text was updated successfully, but these errors were encountered: