-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Integrations don't work when using Sentry Client directly #2329
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
Comments
as a workaround I should add this line to make integrations work: window.__SENTRY__.hub = this.hub; but it doesn't look like right solution |
@akaSybe you missed the last part of the documentation https://github.com/getsentry/sentry-docs/blob/master/src/collections/_documentation/platforms/javascript/advance-settings.md#dealing-with-integrations this.hub.run(currentHub => {
currentHub.captureMessage("Hello");
}); |
Ohh, okay, it'll cover explicit error capturing:
but I guess errors catched on global level ( |
That is correct. In order for global handlers to work with integrations as well, there has to be initialized global instance as well. |
Closing as this seems to be solved. |
Uh oh!
There was an error while loading. Please reload this page.
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
I followed instruction how to use Sentry Client directly: https://github.com/getsentry/sentry-docs/blob/master/src/collections/_documentation/platforms/javascript/advance-settings.md.
My Sentry initialization looks like this:
Bug
Integrations don't work, they don't enhance event
Reason
– On every event, integration's globalEventProcessor called (e.g UserAgent integration): source code
– Sentry looks if current hub has integration (e.g UserAgent): source code
– Sentry looks for current hub: source code
– Sentry checks if there is
window.__SENTRY__.hub
and fails: source code– Sentry creates new hub without client passed as parameter to Hub constructor: source code
–
hub.getIntegration
method returns null cause there is no client: source code– integration skipped cause hub doesn't have current integration :(
The text was updated successfully, but these errors were encountered: