Skip to content

Service Worker: Can't display push notification #19488

Closed

Description

@webmaxru

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Client': PushMessageData object could not be cloned.
    at clients.forEach.client (https://ngsw.surge.sh/ngsw-worker.js:2199:44)
    at Array.forEach (<anonymous>)
    at Driver.broadcast (https://ngsw.surge.sh/ngsw-worker.js:2199:17)
    at <anonymous>

Expected behavior

Show web push notification

Minimal reproduction of the problem with instructions

Click "Subscribe to push" and wait some seconds. Or use "Push" on "Application" tab of DevTools.
Most likely this is because the object passed to postMessagehas methods, not only the properties. Methods have to be removed:
https://stackoverflow.com/a/42376465

CC: @alxhub

What is the motivation / use case for changing the behavior?

Fix the bug

Environment


Angular version: 5.0.0.rc.0


Browser:
- [x] Chrome (desktop) version 61
 

Activity

  1. webmaxru commented on Oct 26, 2017

    @webmaxru
    MemberAuthor

    Fixed by #19764

  2. angular-automatic-lock-bot commented on Sep 12, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  3. locked and limited conversation to collaborators on Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: service-workerIssues related to the @angular/service-worker package

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions