QwikDev / qwik

Instant-loading web apps, without effort
https://qwik.dev
MIT License
20.85k stars 1.31k forks source link

[🐞] Unknown messages throw an error on PrefetchServiceWorker #6921

Open DustinJSilk opened 1 month ago

DustinJSilk commented 1 month ago

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