scripts icon indicating copy to clipboard operation
scripts copied to clipboard

Illegal invocation with sendBeacon and URL has an error

Open adriaandotcom opened this issue 2 years ago • 1 comments

From a very helpful customer, we got this error report:

The following is logged to console: Simple Analytics: Uncaught TypeError: Illegal invocation At this stage, it seems exclusively happening on Chrome/Windows.

Good read: https://xgwang.me/posts/you-may-not-know-beacon/

It does suggest that if a URL has an error, sendBeacon will throw "TypeError: Illegal invocation".

This also seemed to effect the next.js project as well: https://github.com/vercel/next.js/issues/23856 (fix: https://github.com/vercel/next.js/pull/26601/files)

adriaandotcom avatar Aug 28 '23 08:08 adriaandotcom

I've also had this logged to sentry

sendBeacon

mrloop avatar Oct 02 '23 13:10 mrloop