You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS 11.3.x and ngsw-worker.js Safari hangs on image upload #1909
When running my PWA in Safari on iOS 11.3.x, if I try to upload a file to Firebase Storage I see the following error in my Sentry console:
{code_: storage/unknown, message_: Firebase Storage: An unknown error occur…, name_: FirebaseError, serverResponse_: Multipart body does not contain 2 or 3 p…}
I should be able to use Firebase Storage and an Angular Service Worker.
Actual behavior
I have to work around the issue, as follows
platformBrowserDynamic().bootstrapModule(AppModule).then((moduleRef) => {
StaticInjectorService.setInjector(moduleRef.injector);
const isSafari = () => {
return navigator.userAgent.indexOf('Safari') !== -1;
};
if (isSafari()) {
// https://github.com/angular/angular/issues/23244
console.log('Service Worker not registered');
} else {
// https://stackoverflow.com/questions/48723206/angular-5-service-worker-not-working
// Seems to be a problem in registering service worker in module where also importing AngularFire2
if ('serviceWorker' in navigator && ENV.production) {
navigator.serviceWorker.register('/ngsw-worker.js');
console.log('Service Worker registered');
}
}
}).catch(error => console.log(error));
I'm having this issue as well. Thank you for documenting it so well. Do you know if StaticInjectorService is specific to Ionic? I don't see how to implement in plan AngularFire. Thanks!
Activity
mtschauer commentedon Feb 19, 2019
I'm having this issue as well. Thank you for documenting it so well. Do you know if StaticInjectorService is specific to Ionic? I don't see how to implement in plan AngularFire. Thanks!
BluebambooSRL commentedon Jul 21, 2019
I have the same issue... :(
jek-bao-choo commentedon Aug 3, 2019
Same issue
jek-bao-choo commentedon Aug 3, 2019
Did you try @Robinyo's solution?
vandres commentedon Jul 3, 2020
Can reproduce this on iOS12, iOS13 seems to work
jamesdaniels commentedon Nov 18, 2020
ngsw registration was blocked by zone issues, most of those should be addressed now. going to close this issue.