Development page blank on first load
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes
Environment
just says it’s missing app name
Steps to Reproduce
It’s definitely something in my project (upgraded from latest 1.x), because a brand new app works. when I first start the development servers, it has the following html:
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="https://www.google.com/recaptcha/api.js?render=explicit" async defer></script>
<script src="/static/js/bundle.js"></script>
<script src="/static/js/0.chunk.js"></script>
<script src="/static/js/main.chunk.js"></script>
</body>
The Page comes up blank and react-dev-tools (chrome extension) says this page is not using react
It’s almost like the JS is never executed
But as soon as I refresh the page, the page works as expected with the following html served (notice chunk 0 is now chunk 1):
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script src="https://www.google.com/recaptcha/api.js?render=explicit" async defer></script>
<script src="/static/js/bundle.js"></script>
<script src="/static/js/1.chunk.js"></script>
<script src="/static/js/main.chunk.js"></script>
</body>
Expected Behavior
It should just load the right chunk the first time
Actual Behavior
It doesn’t execute react on the first load
Reproducible Demo
Very confidential app. will try to bring it down to an MVP I can share. in the mean time I would love at least a direction to look in. there are absolutely zero errors in the console
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:32 (6 by maintainers)
Top Results From Across the Web
Blank page after running build on create-react-app
I was trying to build an electron app using create-react-app. When running in development everything was fine, but when I built the CRA...
Read more >How to fix the Whitescreen After a Static Deployment with ...
Specifiying “homepage” Now that we told your app it's base URL, run npm run build again and copy the app to your web...
Read more >How to fix the Blank screen After a Static Deployment with ...
Check the browser's console for errors; Check your javascript bundle files are loading properly; Update the “homepage” setting in your package.
Read more >PHP Troubleshooting When Page Loads All White - ThoughtCo
The most common reason for a blank page is that the script is missing a character. If you left out a ' or...
Read more >React Native blank white screen issue (solved) - Coding is Love
Usually, we get a blank screen when the app is not connected to React Native development server. Make sure that you have started...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is my dumb workaround, in case it’s helpful to anyone.
I simply prepended
sleep 2 &&
to the “start-js” script.I actually have the very same problem also in confidential project. Did anyone discovered what is causing the issue?