Skip to content
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

Service worker not loading the external Material icons file when offline #178

Open
alvinkonda opened this issue Apr 19, 2018 · 6 comments
Open

Comments

@alvinkonda
Copy link

This is the file. Any idea how to make it work?
https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons

Thanks

@laurentpayot
Copy link

@alvinkonda you can add this in your workboxOptions of your vue.config.js file:

    runtimeCaching: [
      {
        // Google fonts
        urlPattern: new RegExp('https://fonts.'),
        handler: 'cacheFirst',
        options: {
          cacheName: 'fonts'
        }
      }
    ]

@alvinkonda
Copy link
Author

Hi,
Thanks for your reply!

Sorry but i cant find that file anywhere into my Vuetify PWA template, either workboxOptions i cant find. Can you please give more details

Thnx
Alvin

@laurentpayot
Copy link

laurentpayot commented Apr 19, 2018

Oh sorry wrong repo. I gave you a solution I use with vue CLI 3, where plugins are used instead of templates. You should move to Vue CLI 3 as this PWA template is about to be depreciated (it doesn't use workbox webpack plugin).

I think you can use the runtimeCaching option of my previous post inside the SWPrecachePlugin options here.
(eventually modify it, you have to read the docs of SWPrecachePlugin 😉 )

@alvinkonda
Copy link
Author

Thnx, i tried but it seems to not work plus it is only for production mode as well. Clearly this is a bug with this template, which needed to be solved here as it breaks the scope of progressive web app if the icons are missing on offline mode.

@laurentpayot
Copy link

It used to work for me when I was using this template. Service worker only work in production mode so that's normal.

@alvinkonda
Copy link
Author

clearly a bug with the template. I'm waiting to be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants