Open MicahDavid opened 3 years ago
I have the following method to check for new service worker updates:
async checkSWUpdate() { const self = this const workbox = await window.$workbox; if (workbox) { workbox.addEventListener('installed', (event) => { self.serviceWorkerRefresh = true }); workbox.update() } },
The addEventListener('installed') is creating the following error:
Uncaught TypeError: self.setTimeout is not a function at ServiceWorker.r.S
This is what the compiled javascript code looks like where the error occurs:
, r.S = function(e) { var t = r.m , n = e.target , i = n.state , o = n === r.p , a = o ? "external" : "" , c = { sw: n, originalEvent: e }; !o && r.j && (c.isUpdate = !0), r.dispatchEvent(new u(a + i,c)), "installed" === i ? r.A = self.setTimeout((function() { "installed" === i && t.waiting === n && r.dispatchEvent(new u(a + "waiting",c)) } ), 200) : "activating" === i && (clearTimeout(r.A), o || r.u.resolve(n)) }
Any suggestions on this error?
I have the following method to check for new service worker updates:
The addEventListener('installed') is creating the following error:
Uncaught TypeError: self.setTimeout is not a function at ServiceWorker.r.S
This is what the compiled javascript code looks like where the error occurs:
Any suggestions on this error?