- From: loynoir <notifications@github.com>
- Date: Wed, 14 Apr 2021 03:36:24 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 14 April 2021 10:36:36 UTC
### Control Group that works ```sh $ cat serviceWorker.js importScripts('/a.js'); setTimeout(()=>{ importScripts('/a.js'); }, 1000); setInterval(()=>{ importScripts('/a.js'); }, 1000); $ cat a.js console.log(42) ``` output: ```txt 42 42 42 42 42 ... ``` ### Experiment Group that BOOM ```sh $ cat serviceWorker.js setTimeout(()=>{ importScripts('/a.hashid.js'); }, 1000); setInterval(()=>{ importScripts('/a.hashid.js'); }, 1000); $ cat a.js console.log(42) ``` ```txt Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at '<foobar>/a.js' failed to load. at <foobar>/serviceWorker.js ``` ### Maybe [issue838](https://github.com/w3c/ServiceWorker/issues/838) maybe related? "setTimeout/setInterval are unreliable in ServiceWorker" -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1580
Received on Wednesday, 14 April 2021 10:36:36 UTC