Questions tagged [workbox-window]
16 questions
5
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 _
- 530
- 4
- 14
4
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…

daffinm
- 177
- 1
- 13
3
votes
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…

Alexis Bell
- 151
- 9
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
- 12,468
- 6
- 44
- 63
1
vote
0 answers
React PWA Workbox InvalidStateError
Few users on IOS devices get error InvalidStateError newestWorker is null.
This is my register function using workbox-window just like the documentation mentioned
if ('serviceWorker' in navigator) {
const wb = new…

Oktay Yuzcan
- 2,097
- 1
- 6
- 15
1
vote
0 answers
workbox-window "bad-precaching-response" error and "redundant" service worker
Library Affected:
workbox-window
Browser & Platform:
chromium-based browser
Issue or Feature Request Description:
I'm having this problem only when trying to implement workbox-window. If I remove the implementation, the errors disappear.
My goal is…
1
vote
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…

Khoren Grigoryan
- 21
- 1
- 2
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,…

Joe Longstreet
- 372
- 1
- 5
- 21
1
vote
1 answer
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…

Paul Tymofieiev
- 11
- 2
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…

Andre
- 61
- 5
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,811
- 3
- 40
- 50
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 @…

Code_miss
- 21
- 4
0
votes
1 answer
How to dispatch event on Push receive using Workbox?
I have a VueJS component where I listen for pushMessageEvent :

J.erome
- 688
- 7
- 26
0
votes
1 answer
How to check if service worker is installed and active (using Workbox)?
The Worbox activated event is one way but I'd like to know outside of this event.
Is there some kind of function/method I could call on-demand to check if the registered service worker is installed/active? Like isServiceWorkerActive() or something…

JP _
- 530
- 4
- 14
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…

theeDude
- 107
- 1
- 8