React/WordPress PWA does not respond with a 200 when offline React/WordPress PWA does not respond with a 200 when offline wordpress wordpress

React/WordPress PWA does not respond with a 200 when offline


I finally solved the problem with some help from W3C.

Pass scope option in /src/serviceWorker.js of the react app.

// navigator.serviceWorker.register(swUrl)navigator.serviceWorker.register(swUrl, {scope: "/"})

Configure Apache to serve the Service-Worker-Allowed header for the deployed service worker.

<Files "service-worker.js">    Header Set Service-Worker-Allowed "/"</Files>