Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not an object (evaluating 'this["BS~~U"].replace') #1561

Open
olehleskiv opened this issue Nov 2, 2021 · 3 comments
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. released This feature/bug fix has been released

Comments

@olehleskiv
Copy link

Describe the bug

After updating to the last version we started to receive a lot of identical errors in bugsnag web app from different parts of our application - TypeError: undefined is not an object (evaluating 'this["BS~~U"].replace')

Screenshot at Nov 02 23-50-54

I investigated a bit and found that this commit from 16 Jun is causing this error
ece0635#diff-9b5eddef7819dd0f66be05dc7119868c717bc9c1f93622f446ddbf88ab72ce41R63

Environment

  • Bugsnag version: 7.11.0
  • Browser framework version (if any):
    • Angular: 11.2.14
      Reproducable on different browsers
Error messages:
Error · TypeError: undefined is not an object (evaluating 'this["BS~~U"].replace')
@mattdyoung
Copy link
Contributor

Hi @olehleskiv

Thanks for the detailed report - we're taking a look.

@imjoehaines
Copy link
Member

Hi @olehleskiv,

I've fixed the crash in #1564, which should go out in the next release. However, this error means something about the XMLHttpRequest object isn't quite right and will prevent network breadcrumbs being collected

It'd be good to figure out what is causing this to happen so that it's possible to collect network breadcrumbs in your app. Are you using another library that monkey patches XMLHttpRequest? How do you make network requests in your application?

To elaborate on the cause of this error:

We patch the open method and attach the URL to the XMLHttpRequest instance. The URL can then be read from the same instance in handleXHRLoad

Something is causing the URL to go missing, which implies the XMLHttpRequest instance has been modified between the call to open and the load event firing. It shouldn't be possible for the URL to be missing in any other circumstance as handleXHRLoad will only be called after open is, because we attach the event listener in open

@mattdyoung mattdyoung added bug Confirmed bug scheduled Work is starting on this feature/bug labels Nov 5, 2021
@luke-belton luke-belton added released This feature/bug fix has been released awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. and removed bug Confirmed bug scheduled Work is starting on this feature/bug labels Nov 10, 2021
@luke-belton
Copy link
Member

Hi @olehleskiv - just to let you know we released a fix for this in v7.13.3 of bugsnag-js 🎉

We'd still be interested to hear any thoughts you had in response to Joe's comment above!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. released This feature/bug fix has been released
Projects
None yet
Development

No branches or pull requests

4 participants