Skip to content

sendOnLeave throws a TypeError #47

@adriaandotcom

Description

@adriaandotcom

sendOnLeave throws a TypeError: Illegal invocation on line 554:

nav.sendBeacon(fullApiUrl + "/append", stringify(append));

This is the relevant part of the code:

if (push || !nav.sendBeacon) {
    // sendData will assign payload to request
    sendData(append, undefinedVar, trueVar);
} else {
    nav.sendBeacon(fullApiUrl + "/append", stringify(append));
}

The error happens when nav.sendBeacon is invoked in the else block.

You might want to check if nav or sendBeacon is being called out of context or if there’s an issue with the scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions