Error during service worker registration - Latest Master

Joystick2 years ago

I'm getting below error in web dev on a copy of latest master.
Could anyone offer some assistance on how to sort it please.

serviceWorkerRegistration.js:95

Error during service worker registration: TypeError: Failed to register a ServiceWorker for scope ('https://mydomain.com/') with script ('https://mydomain.com/service-worker.js'): ServiceWorker script evaluation failed
Anton Tananaev2 years ago

Are you sure you haven't changed any files? Looks like some issue with the service worked script.

Joystick2 years ago

Sorry, yes I do have some customized files on the copy of latest master, but had them for some time and did not have the service worker error before. If I refresh the web page I get the error below. Does the error indicate I have broken it on my end?

Uncaught TypeError: d is not iterable
    at Q.addToCacheList (service-worker.js:1:15828)
    at Q.precache (service-worker.js:1:15592)
    at service-worker.js:1:22141
    at service-worker.js:1:22153
    at service-worker.js:1:29896
    at service-worker.js:1:29899
addToCacheList @ service-worker.js:1
precache @ service-worker.js:1
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
(anonymous) @ service-worker.js:1
Anton Tananaev2 years ago

Do you get this error even if you clear all data and cache?

Joystick2 years ago

Yes I have cleared data and cache a few times and also tried it on both Chrome and Edge with the same result.
I'll run a backup copy soon to see if I get the same error.

Anton Tananaev2 years ago

I see that you're using HTTPS, which means you have a proxy. Maybe that messes things up?

Joystick2 years ago

Agree, I will test on http. It looks like the issue is on my end and not with the copy of latest master.
Thanks for assisting.