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

@sentry/tracing Integrations can't be tree-shaked effectively #3310

Closed
4 of 9 tasks
osdiab opened this issue Mar 4, 2021 · 1 comment · Fixed by #4204
Closed
4 of 9 tasks

@sentry/tracing Integrations can't be tree-shaked effectively #3310

osdiab opened this issue Mar 4, 2021 · 1 comment · Fixed by #4204

Comments

@osdiab
Copy link

osdiab commented Mar 4, 2021

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other: @sentry/tracing 6.2.0

Description

Instead of being able to import { BrowserTracing } from "@sentry/tracing" directly, you need to import { Integrations } from "@sentry/tracing", and then get it via Integrations.BrowserTracing.

The result is that my bundle, despite having tree-shaking turned on, ends up including all the integrations, including mongo, postgres, etc - totally irrelevant to my browser web-app.

To avoid a breaking change I suggest just also exporting all the integrations as named members from the @sentry/tracing package, or alternatively exporting them from a separate sub-package like @sentry/tracing/integrations.

@osdiab
Copy link
Author

osdiab commented Mar 5, 2021

ah i see now that i can just require it directly:

import { BrowserTracing } from "@sentry/tracing/dist/browser";

closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant