qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] Unknown messages throw an error on PrefetchServiceWorker

Open DustinJSilk opened this issue 1 year ago • 0 comments

Which component is affected?

Qwik Runtime

Describe the bug

Unknown messages to the PrefetchServiceWorker should thrown an error with console.error('UNKNOWN MESSAGE:', msg);

Because of this line here, if the message is not an array, slice doesn't exist and the function throws an error which is difficult to debug:

  state.$log$('received message:', type, msg[1], msg.slice(2));

The type should be set as unknown and then validated first as a Qwik message before continuing.

Reproduction

N/A

Steps to reproduce

No response

System Info

na

Additional Information

No response

DustinJSilk avatar Sep 28 '24 15:09 DustinJSilk