100lvlmaster / svelte-pwa

An example of svelte pwa
21 stars 2 forks source link

service-worker: timestamp no longer exists #3

Open BillyCallahan opened 2 years ago

BillyCallahan commented 2 years ago

Following the recents svelte-kit updates, timestamp is no longer a member of $service-worker. In fact, it was replaced by version and according to the documentation is "[...] useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches." What do you think about updating the service-worker.ts file ?

Korayem commented 1 year ago

Following the recents svelte-kit updates, timestamp is no longer a member of $service-worker. In fact, it was replaced by version and according to the documentation is "[...] useful for generating unique cache names inside your service worker, so that a later deployment of your app can invalidate old caches." What do you think about updating the service-worker.ts file ?

I just replaced timestamp with version as you suggested, and it worked!

Korayem commented 1 year ago

BTW, there's a full implementation written in sveltekit docs here.

But then again, they recommend using using vite sveltekit pwa plugin, instead of sveltekit's implementation