I’m trying to register a service worker from a view in Theia but it is failing with the following error:
DOMException: Failed to register a ServiceWorker: The document is in an invalid state.
The evidence points to the error being related to registering service workers from dynamically created iframes. Looking at the code in Theia, it seems like there is a workaround for this.
I tried creating an iframe in the same way with the same workaround in a sample project and it did allow me to register a service worker.
I can post my code if needed but what I’m trying is a textbook example of registering a service worker.
Theia version: 0.13 (unable to upgrade a the time being because of certain limitations).
What am I doing wrong or what am I missing?