scripts icon indicating copy to clipboard operation
scripts copied to clipboard

sendOnLeave throws a TypeError

Open adriaandotcom opened this issue 5 months ago • 0 comments

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.

adriaandotcom avatar Sep 26 '24 14:09 adriaandotcom