Title: Service Worker Push requestSubscription error on SAFARI 12 · Issue #27889 · angular/angular · GitHub
Open Graph Title: Service Worker Push requestSubscription error on SAFARI 12 · Issue #27889 · angular/angular
X Title: Service Worker Push requestSubscription error on SAFARI 12 · Issue #27889 · angular/angular
Description: 🐞 bug report Affected Package The issue is caused by package @angular/service-worker Is this a regression? I don't know Description The swPush requestSubscription break on SAFARI browser 🔬 Minimal Reproduction import { Optional, Injectab...
Open Graph Description: 🐞 bug report Affected Package The issue is caused by package @angular/service-worker Is this a regression? I don't know Description The swPush requestSubscription break on SAFARI browser 🔬 Minimal ...
X Description: 🐞 bug report Affected Package The issue is caused by package @angular/service-worker Is this a regression? I don't know Description The swPush requestSubscription break on SAFARI browser 🔬 Mini...
Opengraph URL: https://github.com/angular/angular/issues/27889
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Service Worker Push requestSubscription error on SAFARI 12","articleBody":"# 🐞 bug report\r\n\r\n### Affected Package\r\nThe issue is caused by package @angular/service-worker\r\n\r\n### Is this a regression?\r\nI don't know\r\n\r\n### Description\r\nThe swPush requestSubscription break on SAFARI browser\r\n\r\n\r\n## 🔬 Minimal Reproduction\r\n```javascript\r\nimport { Optional, Injectable } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { SwPush } from '@angular/service-worker';\r\nimport { Observable } from 'rxjs';\r\n\r\nimport { environment } from '../../environments/environment';\r\nimport { PushNotification } from './notification';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NotificationService {\r\n\r\n constructor(\r\n private http: HttpClient,\r\n @Optional() private swPush: SwPush\r\n ) { }\r\n\r\n activate(): Observable\u003cvoid> {\r\n return Observable.create((observer) => {\r\n this.swPush.requestSubscription({\r\n serverPublicKey: environment.webPush.publicKey\r\n }).then((subscription: PushSubscription) => {\r\n this.http.post(`${environment.serverUrl}/subscription`, subscription).subscribe(() => {\r\n observer.next();\r\n observer.complete();\r\n }, (err) => {\r\n observer.error(err);\r\n });\r\n }).catch((err) => {\r\n console.log(err): // => Here an error occurs on Safari : TypeError: undefined is not an object (evaluating 't.subscribe')\r\n observer.error(err);\r\n });\r\n });\r\n }\r\n\r\n sendNotification(notification: PushNotification): Observable\u003cvoid> {\r\n return this.http.post\u003cvoid>(`${environment.serverUrl}/notification`, notification);\r\n }\r\n\r\n messages(): Observable\u003cPushNotification> {\r\n return \u003cObservable\u003cPushNotification>>this.swPush.messages;\r\n }\r\n}\r\n\r\n```\r\n\r\n## 🔥 Exception or Error\r\n\u003cpre>\u003ccode>\r\nTypeError: undefined is not an object (evaluating 't.subscribe')\r\n\u003c/code>\u003c/pre>\r\n\r\n## 🌍 Your Environment\r\n\r\n**Angular Version:**\r\n\u003cpre>\u003ccode>\r\nAngular CLI: 7.1.4\r\nNode: 8.11.3\r\nOS: darwin x64\r\nAngular: 7.1.4\r\n... animations, cli, common, compiler, compiler-cli, core, forms\r\n... language-service, platform-browser, platform-browser-dynamic\r\n... router, service-worker\r\n\r\nPackage Version\r\n-----------------------------------------------------------\r\n@angular-devkit/architect 0.11.4\r\n@angular-devkit/build-angular 0.11.4\r\n@angular-devkit/build-optimizer 0.11.4\r\n@angular-devkit/build-webpack 0.11.4\r\n@angular-devkit/core 7.1.4\r\n@angular-devkit/schematics 7.1.4\r\n@angular/cdk 7.2.0\r\n@angular/material 7.2.0\r\n@angular/pwa 0.11.4\r\n@ngtools/webpack 7.1.4\r\n@schematics/angular 7.1.4\r\n@schematics/update 0.11.4\r\nrxjs 6.3.3\r\ntypescript 3.1.6\r\nwebpack 4.23.1\r\n\r\nAND : \r\n\"@angular/service-worker\": \"~7.1.0\",\r\n\u003c/code>\u003c/pre>\r\n\r\n**Anything else relevant?**\r\nThis issue is on Safari browser Version 12.0.2 (13606.3.4.1.4)\r\n","author":{"url":"https://github.com/robinComa","@type":"Person","name":"robinComa"},"datePublished":"2019-01-02T13:59:01Z","url":"https://github.com/angular/angular/issues/27889"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:817b94f5-c070-2e9b-dc27-844992d533bd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BE40:BBAAA:FDD016:14F943C:6B0107DF |
| html-safe-nonce | a6e4fc44d9ef6778d9a6ba7bfb00467a01a3b55f6ba912f61ed998f3bef1e0ad |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTQwOkJCQUFBOkZERDAxNjoxNEY5NDNDOjZCMDEwN0RGIiwidmlzaXRvcl9pZCI6IjU4NDg5NDI2Njk0MzAwNjUxMjAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1e3a36f831801c8e4890eeb0374d22bb58085c3a26de947d5fdaf6d7b5ecee64 |
| hovercard-subject-tag | issue:395256272 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/27889/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fee9ee214984fe145a4dc4cdeb92602590ba410fe329a6387efac7fa1d8c3d5b/angular/angular/issues/27889 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fee9ee214984fe145a4dc4cdeb92602590ba410fe329a6387efac7fa1d8c3d5b/angular/angular/issues/27889 |
| og:image:alt | 🐞 bug report Affected Package The issue is caused by package @angular/service-worker Is this a regression? I don't know Description The swPush requestSubscription break on SAFARI browser 🔬 Minimal ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robinComa |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width