nuxt-pwa-module icon indicating copy to clipboard operation
nuxt-pwa-module copied to clipboard

Only works with VPN

Open Ahmadheysami opened this issue 2 years ago • 7 comments

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

Is there a solution?

Ahmadheysami avatar Mar 09 '23 19:03 Ahmadheysami

Hi @Ahmadheysami

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

https://github.com/kevinmarrec/nuxt-pwa-module/blob/a7263a2d7c39b1c5a60623c848fe2735e709be1f/src/parts/workbox/index.ts#L36

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.

kevinmarrec avatar Mar 10 '23 11:03 kevinmarrec

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

Ahmadheysami avatar Mar 10 '23 21:03 Ahmadheysami

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 !

kevinmarrec avatar Mar 14 '23 10:03 kevinmarrec

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

Ali-Nasir-01 avatar Mar 18 '23 11:03 Ali-Nasir-01

Thank you Ali

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

Ahmadheysami avatar Mar 18 '23 12:03 Ahmadheysami

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

kevinmarrec avatar Mar 19 '23 12:03 kevinmarrec

@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.

Ali-Nasir-01 avatar Mar 27 '23 08:03 Ali-Nasir-01