-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
8.32.0
Framework Version
No response
Link to Sentry event
Reproduction Example/SDK Setup
// initialisation: https://github.com/vernak2539/chrome-extension-google-doc-default-zoom/blob/main/src/utils/sentry/base.ts
// usage: https://github.com/vernak2539/chrome-extension-google-doc-default-zoom/blob/main/src/contents/index.ts
const sentryClient = new BrowserClient({
dsn: process.env.PLASMO_PUBLIC_SENTRY_DSN,
tracesSampleRate: 1.0,
environment: process.env.NODE_ENV || "development",
release: packageJson.version,
stackParser: defaultStackParser,
integrations: getDefaultIntegrations({}).filter((defaultIntegration) => {
return !["BrowserApiErrors", "Breadcrumbs", "GlobalHandlers"].includes(
defaultIntegration.name
);
}),
transport: makeFetchTransport
});
const sentryScope = new Scope();
sentryScope.setTags({
source,
locale: chrome.i18n.getUILanguage(),
extension: packageJson.name
});
sentryScope.setClient(sentryClient);
sentryClient.init(); // initializing has to be done after setting the client on the scope
sentryScope.setContext('extra', { extra: 'info' })
try {
main()
} catch(err) {
sentryClient.captureException(err);
}
Steps to Reproduce
- Setup client based on https://docs.sentry.io/platforms/javascript/best-practices/shared-environments/
- Set extra context/tags on scope
- Use client in try/catch
Expected Result
I would expect the tags and context set on the sentry scope to be recorded in sentry on issues.
Actual Result
The tags and context are not set on the sentry issue when an error does occur (the error is captured)
Metadata
Metadata
Assignees
Labels
Projects
Status
Waiting for: Product Owner