Illegal invocation on transport file
See original GitHub issueSince April 9th I started seeing errors that I can’t reproduce reaching my users and it seems be more frequently.
I’m using @datadog/browser-rum 2.7.1 which depends on @datadog/browser-core 2.7.1
The raw error is:
TypeError: Illegal invocation
at e.send(../../../src/transport/transport.ts:22:34)
at e.flush(../../../src/transport/transport.ts:68:20)
at apply(../../../src/transport/transport.ts:153:12)
at n(../../src/helpers.ts:87:17)
Line 22 on the source map is:
HttpRequest.prototype.send = function (data, size) {
var url = this.withBatchTime ? addBatchTime(this.endpointUrl) : this.endpointUrl; // <== this one
if (navigator.sendBeacon && size < this.bytesLimit) {
var isQueued = navigator.sendBeacon(url, data);
if (isQueued) {
return;
}
On file @datadog/browser-core/esm/transport/transport.js
.
But this does not seem to make sense as the error is e.send
so it is happening when send is called.
It seems to happen in any browser (Chrome 70/79/80/89, Mobile Safari, Samsung Internet, Chrome Mobile are some examples). I could not reproduce it yet.
Any thoughts or ideas are welcome.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:12 (1 by maintainers)
Top Results From Across the Web
TypeError: Illegal Invocation - Stack Overflow
“Illegal invocation” happens when you call native API with a wrong context object. $c should be the builtin navigator interface, navigator.
Read more >Illegal invocation caused by sendBeacon() call in gtag.js ...
I just wanted to try explicitly setting the transport type to beacon and see if those browsers are still the only ones where...
Read more >Uncaught TypeError: Illegal invocation · Issue #628 - GitHub
I will try to reproduce this. Sorry, i mean the omnisharp flame button , in it's documents it says "To use. Open a...
Read more >"Illegal invocation" errors in JavaScript - Matias Kinnunen
An "illegal invocation" error is thrown when calling a function whose this keyword doesn't refer to the object where it originally did. In...
Read more >Jquery and HTML FormData returns "Uncaught TypeError
I'm using this script to upload my image files: http://jsfiddle.net/eHmSr/ ... Uncaught TypeError: Illegal invocation. jQuery Error. Can you help me?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the two linked PRs has been released in 2.7.4, let us know how it goes
@igrayson: In your screenshot, we can see that the exception is triggered at a place where
window.navigator.sendBeacon
is used followed by awindow.fetch
fallback, which is not done in our codebase. So, this is not the same issue, and probably not related to the RUM Browser SDK (as it does not instrumentnavigator
norsendBeacon
)