Skip to content

Using the inline worker emits errors in browser context. #8

@Kanaye

Description

@Kanaye
TypeError Failed to execute 'postMessage' on 'Window': 2 arguments required, but only 1 present. 

is thrown in the normal browsers window context because window.postMessage expects 2 arguments and is called with one here:

if (typeof postMessage==='function') postMessage(sendQueue);

The easiest way to fix this, is to add extend the condition to be:
if (typeof postMessage === 'function' && postMessage.length === 1)

I'll probably PR later, but I'm documenting my findings while I'm debugging an other error.

Edit: Example emitting this error: https://codesandbox.io/s/10r1j4z06l

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