Handling 'service worker not supported' error in private browsers

Looking at our Airbrake logs, seeing that we get ‘service worker not supported’ errors when the user is in a private browser.

Our Layer0 compatible service worker looks like this:

import { clientsClaim, skipWaiting } from 'workbox-core';

import { Prefetcher } from '@layer0/prefetch/sw';
import { precacheAndRoute } from 'workbox-precaching';

skipWaiting();
clientsClaim();
precacheAndRoute(self.__WB_MANIFEST || []);

new Prefetcher().route();

Any ideas how to bypass the service worker when its not supported?

Our project is a NuxtJS app, v2.15.7

Are you seeing any adverse behavior in your app as a result of the service worker not being supported? In general the service worker should be seen as an optional upgrade that cannot be relied upon to be there at any given moment in the browser. For example, even if the browser supports it, downloading and installing may be delayed. Generally if the service worker isn’t running the only side affect should be lack of prefetching and service-worker based caching. But the app should still function as normal.