Gatsby: Redudant service worker bug

Created on 21 Mar 2018  Â·  14Comments  Â·  Source: gatsbyjs/gatsby

image

When recharge by gatsby website:

Configuration:

module.exports = {
  siteMetadata: {
    title: 'Gatsby Default Starter',
  },
  plugins: [
    'gatsby-plugin-react-helmet',

    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: "DigitalKeys API Documentation",
        short_name: "DigitalKeys API",
        start_url: "/",
        background_color: "#f7f0eb",
        theme_color: "#a2466c",
        display: "minimal-ui",
        icons: [
          {
            "src": "/favicons/android-icon-36x36.png",
            "sizes": "36x36",
            "type": "image/png",
            "density": "0.75"
           },
           {
            "src": "/favicons/android-icon-48x48.png",
            "sizes": "48x48",
            "type": "image/png",
            "density": "1.0"
           },
           {
            "src": "/favicons/android-icon-72x72.png",
            "sizes": "72x72",
            "type": "image/png",
            "density": "1.5"
           },
           {
            "src": "/favicons/android-icon-96x96.png",
            "sizes": "96x96",
            "type": "image/png",
            "density": "2.0"
           },
           {
            "src": "/favicons/android-icon-144x144.png",
            "sizes": "144x144",
            "type": "image/png",
            "density": "3.0"
           },
           {
            "src": "/favicons/android-icon-192x192.png",
            "sizes": "192x192",
            "type": "image/png",
            "density": "4.0"
           }
        ],
      },
    },

    'gatsby-plugin-offline'
  ],
};

Site: https://5ab2502c0b79b74dd086b74b--festive-mestorf-04611b.netlify.com/

Most helpful comment

I have the exact same issue now. Gatsbyjs, my projects, downloaded starters, whichever Gasbyjs, does not work with Chrome right now. And I have tried on the latest (or nearly latest) of everything. Works fine with Firefox and Safari. But the question is, would I really want to work with either of those browsers? I got the following warning in Chrome Developer Tools Console:

app.js:66 Warning: found one or more service workers present. If your site isn't behaving as expected, you might want to remove these.

And a zillion messages from workbox. I use it in my regular React projects and never had a problem. But there is a problem here all of a sudden. I have been removing the .cache, public, node_modules, and re-installing, re-building, updating plugins, etc. Nothing helps. Just started all of a sudden yesterday. But I think it has been slowly building up to this.

All 14 comments

I do not know, this kind of thing does not happen in create-react-app or in workbox. I had to migrate my entire site.

I have same issue but just at Chrome.
So, I think this issue is related with Chrome.

But, still I do not know how to deal it.

Workbox

2018-03-22 10:53 GMT-04:00 Andrea Kim notifications@github.com:

I have same issue but just at Chrome.
So, I think this issue is related with Chrome.

But, still I do not know how to deal it.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/gatsbyjs/gatsby/issues/4636#issuecomment-375334660,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AL6SdTnZZYaTKmebamGcoVLjw3Mk4I-Uks5tg7rUgaJpZM4Sz7vW
.

I'm having the same issue on multiple unrelated sites, pretty sure it's recent. Only happens when I reload the page while the developer console is opened in Chrome. Some kind of loop going on there. Additional warning:

Service Worker was updated because "Update on reload" was checked in the DevTools Application panel.

This warning is normal. @fabe. The SW can work with normality even the warning exist

@CharlyJazz Yes, but the warning is being shown constantly in an infinite loop, together with the redundancy error. Here's a video. Sorry for the confusion.

https://api-platform.com also has this problem, in the exact same conditions (only on Chrome, and everytime we deploy a new version).
It prevents the site from working until the browser fetches a fresh SW.

Should be fixed now. If you encounter other issues with serviceWorker please open up a new issue!

@LekoArts Interesting, I see a comment that this issue is fixed? but I ran into the exact same issue as the original poster now with the latest version of gatsby/the offline plugin.

I have the exact same issue now. Gatsbyjs, my projects, downloaded starters, whichever Gasbyjs, does not work with Chrome right now. And I have tried on the latest (or nearly latest) of everything. Works fine with Firefox and Safari. But the question is, would I really want to work with either of those browsers? I got the following warning in Chrome Developer Tools Console:

app.js:66 Warning: found one or more service workers present. If your site isn't behaving as expected, you might want to remove these.

And a zillion messages from workbox. I use it in my regular React projects and never had a problem. But there is a problem here all of a sudden. I have been removing the .cache, public, node_modules, and re-installing, re-building, updating plugins, etc. Nothing helps. Just started all of a sudden yesterday. But I think it has been slowly building up to this.

I'm seeing this issue sporadically on a site that has been live for awhile now. Having a hard time replicating it but I'll keep trying. As far as I know it only ever happens when dev tools is open in Chrome. All packages are up-to-date.

I have same issue with gatsby, continuously reload site in chrome in dev mode.

can you post a screenshot of the application tab?
image

Also please open a new ticket with new information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  Â·  3Comments

rossPatton picture rossPatton  Â·  3Comments

3CordGuy picture 3CordGuy  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

theduke picture theduke  Â·  3Comments