Gatsby: Offline plugin not catching icons from manifest plugin

Created on 29 Nov 2019  路  13Comments  路  Source: gatsbyjs/gatsby

Description

When using both offline plugin and manifest plugin, icons generated will not be cached.

Steps to reproduce

Demo project here

Run gatsby build and gatsby serve, refresh page a couple of times, turn offline, refresh again.

Expected result

It caches the icon and shows it offline.

Actual result

Icon is not cached and doesn't show when offline. Checking the workbox logs shows that it doesn't take any caching action for the icons and fails when it tries to fetch it while offline.

Environment

I'm away from my computer right now since I had to leave and I'm submitting this on my phone.

I'm on Linux x64 Arch, using Chrome stable, latest version of all packages (at least since yesterday afternoon).

good first issue help wanted documentation

All 13 comments

Have you tried placing the manifest plugin above the offline plugin in gatsby-config?

It already is. You can check yourself in the project provided. It caches the manifest itself, just not the icons

I was able to fix it with these settings:

{
   resolve: 'gatsby-plugin-manifest',
   options: {
      icon: 'icon.svg',
      cache_busting_mode: 'none'
   }
},
{
   resolve: 'gatsby-plugin-offline',
   options: {
      workboxConfig: {
         globPatterns: ['**/*']
      }
   }
}

The cache_busting_mode is there since the query parameter cache busting would break workbox since it could never find the cached URLS.
And the globPatterns is there so offline will cache everything.

Even though this technically fixes I still feel something like this should work out of the box or at the very least have documentation somewhere explaining how to get it working.

We'd be happy to receive a PR updating the README to include this :)

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鈥檚 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!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 馃挭馃挏

Let me re-open this, it seems easy and a good addition to your docs.

Which README file must be edited? I'll add it :)

add it to gatsby-plugin-offline and gatsby-plugin-manifest is what I would say.

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鈥檚 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!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

I moved onto other projects and haven't touched Gatsby for a while but is there a reason why this doesn't work out of the box or why it can't be fixed?

Seems kind of silly (imo) that this does not work without workarounds, especially since they're both official plugins recommended by the docs for creating a PWA which would be the first result if someone was looking for it, only for it to not cache the favicons which is definitely unexpected.

At the very least since they're both official plugins can't they detect each other and modify their default config accordingly?

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鈥檚 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!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey @matanui159 , i already opened pull request documenting your issue, check it out in #22462

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

brandonmp picture brandonmp  路  3Comments

andykais picture andykais  路  3Comments

theduke picture theduke  路  3Comments

hobochild picture hobochild  路  3Comments