question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browser tags not sent anymore with BrowserClient initialization

See original GitHub issue

Package + Version

  • [ 5.15.0] @sentry/browser
  • [ 5.15.0] @sentry/hub

Description

On Sentry we don’t get browser tags (browser, os and device data) on events since the update of @sentry/browser to version 5.15.0. It works with version 5.14.2. In the request payload, the request key doesn’t exist anymore, so useragent isn’t sent. Sentry is initialized creating manually new BrowserClient & new Hub. Initializating Sentry with Sentry.init fixes the problem, but we intend to have multiple initialization on the page so this is not a solution.

const integrations: Integration[] = [...defaultIntegrations, new ExtraErrorData(), new Dedupe()];
const environment = guessEnvironment();
if (environment !== ENV.PRODUCTION) {
  integrations.push(new Debug());
}
const client = new BrowserClient({
  dsn: '******,
  release: guessRelease(),
  environment,
  integrations,
  enabled: true,
});
hub = new Hub(client);
makeMain(hub);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilogorekcommented, Jun 17, 2020

@Mattgic you need to call hub.bindClient(client) after creating a hub. It was an oversight on our side and it has been already fixed - https://github.com/getsentry/sentry-javascript/pull/2665 (release is pending, so should be available early next week).

1reaction
Mattgiccommented, Jun 17, 2020

Wow. It works, thanks a lot 😃 Should have asked earlier 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page view triggers - Tag Manager Help - Google Support
The Consent Initialization trigger is not used for tags that should fire early ... Page View: Fires immediately when the web browser begins...
Read more >
Which drivers support "no-browser"/"headless" testing?
To execute your Test Suite through Selenium without opening any browser you can use any of the Browser Client from the following list...
Read more >
@sentry/browser | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
User-Agent Client Hints - GitHub Pages
1.2.1.1 Based on browser features; 1.2.1.2 Browser bug workaround ... Both of these hints are not sent by default, so require some extra ......
Read more >
init | API Reference - Nightwatch.js
.init(). This command is an alias to url and also a convenience method when called without any arguments in the sense that it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found