We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f35a687 commit 70dcea9Copy full SHA for 70dcea9
src/client/build/register.ts
@@ -37,7 +37,12 @@ export function registerSW(options: RegisterSWOptions = {}) {
37
38
async function register() {
39
if ('serviceWorker' in navigator) {
40
- const { Workbox } = await import('workbox-window')
+ const { Workbox } = await import('workbox-window').catch(() => ({Workbox: null}));
41
+ if (!Workbox) {
42
+ // Workbox could not be imported.
43
+ return;
44
+ }
45
+
46
// __SW__, __SCOPE__ and __TYPE__ will be replaced by virtual module
47
wb = new Workbox('__SW__', { scope: '__SCOPE__', type: '__TYPE__' })
48
sendSkipWaitingMessage = async () => {
0 commit comments