Skip to content

Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED. #9747

Closed
@TimTheToad

Description

@TimTheToad

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

Sentry Browser CDN bundle

SDK Version

7.85.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

    Sentry.onLoad(function () {
        Sentry.init({
            environment: "staging",
            release: "v1.0",
            beforeSend(event) {
                if ('NO' !== 'YES') {
                    return null
                }
                return event
            },
            beforeBreadcrumb(breadcrumb, hint) {
                if (breadcrumb.category === 'xhr') {
                    // hint.xhr is a whole XHR object that you can use to modify breadcrumb
                    breadcrumb.data = hint.xhr
                }
                return breadcrumb
            },
            integrations: [
                new Sentry.Replay({
                    networkDetailAllowUrls: ['*'],
                }),
            ],

        })
    })

We are using CDN Bundle:
bundle.replay.min.js

Steps to Reproduce

Any error invoked and captured by Sentry will generate the foillowing error:
InvalidStateError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED.

This suddenly started to appear on the 27th of November.
Our only way to resolve it was to remove Sentry in our code.

Expected Result

Expected result would be a captured Sentry event that we later may review.

Actual Result

image

Stack Trace:
image

As you can see it seems to me like Sentry is intercepting axios requests. (Marked the row that throws the error. )
image

We have tried updating axios to the latest version as well without any results.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions