I relate to this answer from @woxxom: particularly to this warning:
Warning! Don't import DOM-based libraries like jQuery because service workers don't have DOM so there's no document, XMLHttpRequest, and so on.
How to use and access DOM with XMLHttpRequest in v3 context?