kevinmarrec / nuxt-pwa-module

⚠️ DEPRECATED ⚠️ Zero config PWA solution for Nuxt 3
MIT License
334 stars 32 forks source link

Only works with VPN #100

Open Ahmadheysami opened 1 year ago

Ahmadheysami commented 1 year ago

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

Is there a solution?

kevinmarrec commented 1 year ago

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.

Ahmadheysami commented 1 year ago

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

kevinmarrec commented 1 year ago

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 !

Ali-Nasir-01 commented 1 year ago

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

Ahmadheysami commented 1 year ago

Thank you Ali

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

kevinmarrec commented 1 year ago

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

Ali-Nasir-01 commented 1 year ago

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