From 4aa45f1259eb7b94af4b87d371e5148eca5a7e2b Mon Sep 17 00:00:00 2001 From: bymyself Date: Sat, 25 Oct 2025 00:05:06 -0700 Subject: [PATCH] [bugfix] remove await from service worker registration to prevent blocking app mount The await was causing the app to hang on deployment with a white screen because the service worker registration promise was not resolving. Changed back to void import() to allow the app to mount immediately while service worker registration happens in the background. --- src/main.ts | 3 +-- src/platform/auth/serviceWorker/index.ts | 2 +- src/platform/auth/serviceWorker/register.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 301612f0f..90e060bb8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -86,9 +86,8 @@ app }) // Register auth service worker after Pinia is initialized (cloud-only) -// Wait for registration to complete before mounting to ensure SW controls the page if (isCloud) { - await import('@/platform/auth/serviceWorker') + void import('@/platform/auth/serviceWorker') } app.mount('#vue-app') diff --git a/src/platform/auth/serviceWorker/index.ts b/src/platform/auth/serviceWorker/index.ts index 518723fc7..c83e238d5 100644 --- a/src/platform/auth/serviceWorker/index.ts +++ b/src/platform/auth/serviceWorker/index.ts @@ -5,5 +5,5 @@ import { isCloud } from '@/platform/distribution/types' * Tree-shaken for desktop/localhost builds via compile-time constant. */ if (isCloud) { - await import('./register') + void import('./register') } diff --git a/src/platform/auth/serviceWorker/register.ts b/src/platform/auth/serviceWorker/register.ts index 0f44f3b9b..eda954dba 100644 --- a/src/platform/auth/serviceWorker/register.ts +++ b/src/platform/auth/serviceWorker/register.ts @@ -54,4 +54,4 @@ function setupCacheInvalidation(): void { }) } -await registerAuthServiceWorker() +void registerAuthServiceWorker()