Skip to content

postmessage console log when e.data is empty or contains an undefined property #18

@mdurling

Description

@mdurling

We are using a package that depends on postmessage. We get multiple warnings in the console log because postmessage complains it can not parse the JSON in the messages. This happens in 2 distinct scenraios:

  1. When e.data is empty '' or undefined, and
  2. When e.data contains a property that is undefined

There should be a way to suppress these warnings as they clutter the console and inhibit debugging. I believe if postmessage can't parse the messages that it should just silently ignore them. Or it should be marking messages that are sent using postmessage and ignoring messages that were sent using window.postMessage directly.

The warnings are for messages sent via window.postMessage that aren't even to/from the package that is depending on postmessage ... the messages that are causing the warnings are coming from the Redux DevTools Chrome extension and Webpack Dev Server.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions