kevinmarrec/nuxt-pwa-module

Only works with VPN

Opened this issue · 7 comments

Hello, I used this module and unfortunately it only works with VPN and otherwise it fails.

Is there a solution?

Hi @Ahmadheysami

What's exactly happening when not using VPN ? Is your network preventing access to google URLs ?

options.workboxUrl = `https://storage.googleapis.com/workbox-cdn/releases/${options.workboxVersion}/workbox-sw.js`

If it does, you may try to host yourself the google Workbox script somewhere and use workboxUrl option to point to the self-hosted script.

Probably because I am in Iran, I do not have access to Google services

Can you make a way for my situation?

I would be very grateful if you could

I don't know if self-hosting the script somewhere would work, I would be afraid it internally relies on fetch calls on other google services inside. I will need to check !

Hey @Ahmadheysami
I think you can use other workboxes CDN like https://cdn.jsdelivr.net/npm/workbox-cdn/workbox/workbox-sw.js

You can add it by option like the below example on nuxtConfig
workbox: { enabled: true, workboxUrl: "https://cdn.jsdelivr.net/npm/workbox-cdn/workbox/workbox-sw.js" }
And for more information, you can read this.

It works for me

Thank you Ali

If it worked for you. So it definitely works for me
Thanks again for your help
I will definitely try

The only issue here is that the workbox-cdn is using Workbox v5, we would need to update it to v6.

@kevinmarrec Feel free to close the issue because in Iran we can't use google URLs. we fix this problem by using other CDNs and It's not about v5 or v6 at all.