[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.
This commit is contained in:
bymyself
2025-10-25 00:05:06 -07:00
parent 3954ac8584
commit 4aa45f1259
3 changed files with 3 additions and 4 deletions

View File

@@ -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')

View File

@@ -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')
}

View File

@@ -54,4 +54,4 @@ function setupCacheInvalidation(): void {
})
}
await registerAuthServiceWorker()
void registerAuthServiceWorker()