Questions tagged [workbox-window]

15 questions
2
votes
1 answer

Inconsistent behaviour with workbox-window.update()

Platform "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36" Workbox version 5.0.0-rc.0 I am using the workbox-window update() method to trigger a service worker update check as described in…
2
votes
1 answer

How to send a message from service worker to a Workbox class instance's "message" event?

I have this in my window.js... const wb = new Workbox('sw.js'); wb.messageSW({type:'START'}); wb.addEventListener('message', e=>{ console.log(e); }); ...in my sw.js, I have... self.addEventListener('message', (e)=>{ if (e.data) { …
JP Del Mundo
  • 332
  • 3
  • 10
2
votes
0 answers

How to offer a page reload when the service worker is updated after a page refresh?

I'm currently using the latest Workbox version 4.3.1 with workbox-window, I'm offering a page reload for users by listening to the waiting event, I'm using the code provided on the Advanced Recipes page of the Workbox documentation. The code on the…
Pierre
  • 10,430
  • 5
  • 37
  • 57
1
vote
1 answer

Workbox precache doesn't precache

I'm attempting to implement workbox to precache image and video assets on a website. I've created a service worker file. It appears to be successfully referenced and used in my application. The service worker: import { clientsClaim,…
1
vote
0 answers

Workbox service worker Manual Update flow

this is my implementation in react spa of sw registration and refreshing. The problem is when I trigger manual update on current sw and accept new version (e.g. send post message SKIP WAITING event in active sw) and after new sw gets activated I…
1
vote
1 answer

Serviceworker never gets activated or receives messages but workbox functionality works on subpaths

In my current project using webpack with (workbox-webpack-plugin) and workbox (with workbox-window) I have encountered an error where the serviceworker will never respond to messages when the page is loaded at a "deep url", like…
1
vote
0 answers

How to make site available offline using Laravel Mix Workbox

I have a Laravel Vue PWA using Laravel Mix Workbox. In webpack.mix.js I have: mix .js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css') .generateSW({ additionalManifestEntries: [{url: 'index.php',…
Felix Eve
  • 3,426
  • 3
  • 36
  • 48
1
vote
1 answer

Enabling logging when using workbox-webpack-plugin

My project had an old partial implementation of a service worker using Workbox. I've been tyring to update it and add functionality along the way. Somewhere in this process I've lost the Workbox logs in the dev Console (Chrome Version…
1
vote
1 answer

Workbox window failing to install service worker

I'm migrating form v3 to v4 , using workbox-window(CDN)and workbox-webpack-plugin in my vuejs app. It works fine locally with http-server, but after deploying, I get this error and it fails to install the service worker. print @…
0
votes
0 answers

safari 14.1 thinks there is a SW update when there isn't when I call update() on workbox.window

This just started happening this morning, even though I haven't pushed an update for 6 days. A few of our webapp users suddenly get update messages, and when they click update it appears to work but then they come back right away. I'm using…
Steve
  • 675
  • 2
  • 18
0
votes
1 answer

Precached content does not load from cache

In my React SSR application I have implemented service worker(via Workbox). It's working fine. Every time when I am changing some piece of code, rebuilding again, running the server, going to the browser, I am seeing that my cache was updated…
0
votes
0 answers

How to know when service worker is already up to date?

I'm using Workbox with my PWA, and I'm currently adding a Check for Updates button that lets my users check for a new version of my app. When this button is clicked, I show a spinner and call the update() method, which is very concisely documented…
0
votes
0 answers

Workbox, ServiceWorkers Why does DOM cleans itself on lifecycle status change

I'm implementing the Workbox lifecycle displayer. The DOM changes in every lifecycle event. But somehow DOM cleans itself and even leaves placeholder value - after cleaning the name of the version. Here is how it implemented: [ 'installed', …
0
votes
1 answer

Error registering service-worker script with production build

I'm using Workbox Webpack plugin (v4.3.1) to generate a service worker script and Workbox-Window (v4.3.1) plugin to register it. It all works fine on dev environment (I use webpack dev server) but with the production build I'm getting the error…
0
votes
1 answer

Workbox in Polymer 3 SPA, getting "process is not defined"

Polymer 3 SPA trying to migrate from sw-precahe to Workbox. I use the workbox-window module to integrate the lifecycle into the application to enable users to be informed of new versions. I use the 5.0.0-beta version to be able to use the…
nobba
  • 135
  • 6