ServiceWorker thinks I'm offline when I'm not

Hi everyone,

There is a user on our forum (forum.matomo.org) who is having a really similar issue.

After clicking on an external link and pressing back, he isn’t able to access the forum any more, but only gets an Cannot load app - It looks like you are offline! Please check your network connection and try again error.
Removing the service worker only fixes the issue temporarily.

Does anyone have an idea on how to fix it and avoid getting the error again

You can find more information here:
https://github.com/matomo-org/matomo/issues/12588