diff --git a/packages/service-worker/src/module.ts b/packages/service-worker/src/module.ts index b9ca82328e..7cdf55e7e2 100644 --- a/packages/service-worker/src/module.ts +++ b/packages/service-worker/src/module.ts @@ -30,8 +30,10 @@ export function ngswAppInitializer( op_filter.call(app.isStable, (stable: boolean) => !!stable) as Observable; const isStable = op_take.call(onStable, 1) as Observable; const whenStable = op_toPromise.call(isStable) as Promise; - return whenStable.then(() => navigator.serviceWorker.register(script, options)) - .then(() => undefined) as Promise; + + // Don't return the Promise, as that will block the application until the SW is registered, and + // cause a crash if the SW registration fails. + whenStable.then(() => navigator.serviceWorker.register(script, options)); }; return initializer; }