Service worker registration failed in Safari angular 8
See original GitHub issueI updated my application from angular v7 to angular v8 and I have some problems with service workers with Safari. I have same error when enter in www.angular.io
[Error] Service worker registration failed with: TypeError: TypeError: Type error run (polyfills-es2015.75c15c263061f321fee9.js:1:1925) (anonymous function) (polyfills-es2015.75c15c263061f321fee9.js:1:12750) runTask (polyfills-es2015.75c15c263061f321fee9.js:1:2544) _ (polyfills-es2015.75c15c263061f321fee9.js:1:8987) promiseReactionJob
Safari Version 12.1.1 (14607.2.6.1.1) MacOs Mojave v10.14.5 Node v10.16.0
My package.json
{ “dependencies”: { “@angular/animations”: “^8.0.1”, “@angular/cdk”: “^8.0.1”, “@angular/common”: “^8.0.1”, “@angular/compiler”: “^8.0.1”, “@angular/core”: “^8.0.1”, “@angular/forms”: “^8.0.1”, “@angular/material”: “^8.0.1”, “@angular/platform-browser”: “^8.0.1”, “@angular/platform-browser-dynamic”: “^8.0.1”, “@angular/platform-server”: “^8.0.1”, “@angular/pwa”: “^0.800.3”, “@angular/router”: “^8.0.1”, “@angular/service-worker”: “^8.0.1”, “@nguniversal/express-engine”: “^8.0.0-rc.1”, “@nguniversal/module-map-ngfactory-loader”: “^8.0.0-rc.1”, “compression”: “^1.7.4”, “tslib”: “^1.10.0”, “rxjs”: “~6.4.0”, “zone.js”: “~0.9.1” }, “devDependencies”: { “@angular-devkit/build-angular”: “^0.800.3”, “@angular/cli”: “^8.0.3”, “@angular/compiler-cli”: “^8.0.1”, “@angular/language-service”: “^8.0.1”, “@types/express-useragent”: “^0.2.21”, “@types/jasmine”: “^3.3.13”, “@types/jasminewd2”: “^2.0.6”, “@types/node”: “^12.0.8”, “codelyzer”: “^5.1.0”, “express”: “^4.17.1”, “jasmine-core”: “~3.4.0”, “jasmine-spec-reporter”: “~4.2.1”, “karma”: “~4.1.0”, “karma-chrome-launcher”: “~2.2.0”, “karma-coverage-istanbul-reporter”: “~2.0.1”, “karma-jasmine”: “~2.0.1”, “karma-jasmine-html-reporter”: “^1.4.0”, “protractor”: “^5.4.2”, “ts-loader”: “^6.0.2”, “ts-node”: “^7.0.1”, “tslint”: “^5.17.0”, “typescript”: “~3.4.5”, “webpack-cli”: “^3.3.4” } }
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (11 by maintainers)
Top GitHub Comments
@H--o-l Thanks for your thoughtful reply. Yes you are right. We have found the issue and resolved it and initially it felt like a regression but after doing intense debugging it appears to have been an error occurring due to some library updates on Server Side.
It was indeed a bug that was only showing up in Safari when the ServiceWorker was trying to send a POST request to server and being denied access. Everything was working fine on Chrome and Firefox. Safari was adding
Pragma
andCache-control
headers with the service worker request which were being denied on the server because they weren’t in the allowed headers list. I cannot seem to understand why we are unable to reproduce this error using Postman. Anyways - Yes, what appeared to have been a regression was NOT actually a regression (but it was indeed quite weird issue to debug)@kara Service worker using Safari is not working in Angular 8.2.0 anymore. The POST requests are giving Gateway 504 errors.
UPDATE: This is the error i am getting
2nd UPDATE: Turns out the error was coming in Safari due to some server side configuration. Its not a regression in Angular 8.2.0