-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-plugin-offline] ServiceWorker registration causes a quick blank page on website loading/refresh #11006
Comments
Love the incremental editing on this one 😛 Jokes apart, hi @WhippetsAintDogs! Waiting on the rest of the details but based on the title, this looks like it could be potentially related to #10998 Check out the README at the https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-offline#notes cc @LekoArts |
Haha sorry for that, I missclicked on submit before even completing the title xD. And yes, #10998, it might be the same root cause of the problem but not the same symptom. |
Sounds like #9346, too. I don't know if the PR of @pieh fixed the blank page issue. @WhippetsAintDogs Are there some JS errors in console during blank page? |
@cardiv No, not at all. I think it's just the registration process of the SW that blocks the normal render. Delaying it could fix that, I suppose. |
Thanks @WhippetsAintDogs! You may have the latest version which fixes the errors. But the blank pages appeared very randomly on my end. I didn't check it again. |
All right, I'll try the latest version, stay posted. On the other hand, on my end, the blank pages are appearing consistently. Currently I have gatsby 2.0.55 and gatsby-plugin-offline 2.0.17. |
@cardiv I've tried with gatsby 2.0.91 and gatsby-plugin-offline 2.0.21 and I still get consistent blank pages appearing in production when the ServiceWorker in on. |
@WhippetsAintDogs first thing to rule out is to make sure you're using the latest version of We've actually seen this issue on gatsbyjs.com intermittently, and we haven't noticed it for quite a while running the latest version of the offline plugin. |
Hi @DSchau, like I said in my previous post, I still have the issue with gatsby 2.0.91 and gatsby-plugin-offline 2.0.21. Edit: Something else must be different (than gatsbyjs.com). Does gatsbyjs.com runs a vanilla ServiceWorker configuration ? |
Whoops - I saw the Do you have somewhere where we can reproduce? Could you share which page (in particular) and browser version(s) as well? Also the console logs will probably have an error, so a screenshot/paste of those would be super helpful too! |
Yes, this is the page I was talking about: Fika Productions. I use Chromium 71.0.3578.98 (Official Build) Arch Linux (64-bit). There's no errors at all in the console. |
After a few tests, i can confirm that this still happens on gatsbyjs.org. Blank page and after a second, the page renders. But, I haven't noticed blank pages that require a reload to get rid of. The site you linked behaves the same (blank page for a sec). But that doesn't occur every time on my end. |
I'm also getting this. I try to refresh, no matter how many times I see a blank screen. Many users reported they can't access the website because they get a white page. It's so annoying as it seems to affect many people. :( All reports were on mobile. iOS and Android. Chrome and opera I think. Maybe more, but these for sure were affected at least once. Sometimes deploying it again fixes the issue. |
I'm also getting this like this website.When loading for the first time, the content area will flash。 This problem no longer occurs when I remove the gatsby-plugin-offline plugin。like this I guess the gatsby-plugin-offline plugin will re-render my page. any help?thanks. |
Oh,sorry,I forgot to show my codes.Although I think there shouldn't be too many problems in my code, I still show you the code that has problems online. this my respository,only master.thanks. |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
@gatsbybot not stale |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
This isn’t stale. |
I've removed the offline plugin, added the "remove-serviceworker" plugin, but it still happens occasionally on pages I haven't visited in a while. /sigh |
Anyone have some news on this ? Having exatcly the same problem. |
Same problem... |
I'm also facing a similar problem when testing my website on a mobile browser (Chrome 76.0.3809.89). After refreshing the web page, the screen would sometimes become blank for 2~3 seconds before the page reloads. Other times, the screen would remain blank and I would have to close and reopen the browser. Also, my page sometimes freezes after the screen is blank for 2-3 seconds and the page loads. Here is a link to my site: https://clever-kepler-aac0d1.netlify.com Update I've managed to reproduce the issue and provide some screenshots and video. BTW, this issue happens intermittently/randomly and is difficult to reproduce. Here is a screenshot of the network activity when I manually refresh the webpage. Notice that the request for Here is another screenshot of the network activity once the page finally loads. Notice how it took approximately 50 seconds for the white screen to go away and the page to refresh. Here is a link to the video reproducing the blank white screen while waiting approximately 22 seconds for |
This issue is alive? I'm with this problem |
Same issue here. Except the blank page only happens on mobile (dev tools + actual iOS device) |
Same here |
Same here, still saw blank site when reload :( did anyone solve this problem? |
This bug only came after I had done another release to production, after the update, white screen. Before, it was working. No option but to remove the service worker plugin. |
Seeing this problem still exists with the latest version of Gatsby and plugin-offline, even using all official code with no tweaks. Steps to reproduce:
|
I am also seeing this in our project now (https://www.8x8.com). Using the latest. Here are the relevant details: package.json:
gatsby-config.js:
As you can see, we have a pretty vanilla config re: gatsby-plugin-offline, so its interesting that there are these issues. Now, I know we have a lot that needs to be improved upon in terms of bundle size, and excess json being loaded, but from what I can tell that is not what is contributing to the white screen, as that only happens with a service worker enabled and only on the subsequent page loads, not the first. Any insights would be appreciated. UPDATE: I have found that this seems to be directly related to a script we are loading from vidyard. It is causing over 200MB of data to be cached by the service worker, but I have no idea why or where it is coming from. This is also what is causing the blank screen to flash before the page loads it seems. If I block this script and then clear data, the behavior goes away and the site's cache is around 3MB. UPDATE 2: vidyard was a bit of a red herring. I actually have a handful of scripts that get added to either the
|
Same problem here. Nothing to add from what others have already captured. Disabling the plugin works for now. |
I experienced this same issue in Firefox and Safari, but not in Chrome. This forked version of gatsby-plugin-offline with a newer version of workbox seemed to resolve the blank page on refresh for my project: https://github.com/kije/gatsby-plugin-offline-next There are other issues I've run into where certain routes, including the site root, are not available offline with this plugin. I'm temporarily not using it with Gatsby. |
Hi everyone, I have the same issue since months and we can't figure out how to solve it. The blank screen/white page occurs after a deployment of a new version of a Gatsby website. After the deployment, if an user visit the website he will see the white page and only after an hot reload, cache cleaning or incognito mode, the user can navigate into the website normally. I have installed a service worker with gatsby-plugin-offline but then I removed it cause was causing more issues with the cache then anything else. So I added the plugin to remove the serviceworker from the users. The problem is still there. It is random and it is causing lot of problems with the customer. I can't belive that Gatsby has still so many issues and complexities in the main aspects of web development. We build websites with gatsby for its performances, but sometimes is becoming not worthy cause of the amount of problems and issues caused by the gatsby plugins and/or not supported versions. We urgently need a fix for this otherwise any performance test on a gatsby website with this issue will fail brutally. |
I did not install gatsby-plugin-offline but still get the same issues reported from my customers since a few months. |
That's interesting, we have exactly the same problem. Can't say whether that problem is because of that |
Hi! I'm closing this as a stale issue as in the meantime Gatsby 4 and related packages were released. You can check our Framework Version Support Page to see which versions currently receive active support. If this is a feature request, please create a discussion as we moved feature requests from issues to GitHub Discussions. Please try the mentioned issue on the latest version (using the Thanks! |
Description
In a project using the gatsby-offline-plugin, in production (gatsby build), when you access or refresh a page, you'll get a quick blank page instead of the styled HTML from the React's render. Disabling the ServiceWorker from Chrome's DevTools (bypass for network) fixes this.
Steps to reproduce
Expected result
Not having any blank page rendering as it is when you disable the ServiceWorker.
Actual result
A blank page appears before the page starts rendering.
My thoughts on the problem
I think that the registration of the ServiceWorker is blocking the React's render and that delaying it after everything is loaded should fix this. Related: https://stackoverflow.com/questions/47637126/why-my-service-worker-block-the-render
Environment
System:
OS: Linux 4.20 Arch Linux undefined
CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Shell: 4.4.23 - /bin/bash
Binaries:
Node: 11.6.0 - /usr/bin/node
Yarn: 1.10.1 - ~/.yarn/bin/yarn
npm: 6.5.0 - /usr/bin/npm
Languages:
Python: 3.7.2 - /usr/bin/python
Browsers:
Firefox: 64.0
npmGlobalPackages:
gatsby-cli: 2.4.8
The text was updated successfully, but these errors were encountered: