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 488e1ebCopy full SHA for 488e1eb
src/client/build/register.ts
@@ -37,7 +37,14 @@ export function registerSW(options: RegisterSWOptions = {}) {
37
38
async function register() {
39
if ('serviceWorker' in navigator) {
40
- const { Workbox } = await import('workbox-window')
+ const WorkboxWindow = await import('workbox-window').catch((e) =>
41
+ onRegisterError?.(e)
42
+ )
43
+ if (!WorkboxWindow) {
44
+ return
45
+ }
46
+
47
+ const { Workbox } = WorkboxWindow
48
// __SW__, __SCOPE__ and __TYPE__ will be replaced by virtual module
49
wb = new Workbox('__SW__', { scope: '__SCOPE__', type: '__TYPE__' })
50
sendSkipWaitingMessage = async () => {
0 commit comments