Skip to content

Illegal invocation with sendBeacon and URL has an error #42

Description

@adriaandotcom

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: vercel/next.js#23856 (fix: https://github.com/vercel/next.js/pull/26601/files)

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