-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
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/react
SDK Version
8.15.0
Framework Version
18.3.1
Link to Sentry event
No response
SDK Setup/Reproduction Example
Sentry.init({
debug: true,
dsn: 'our-dsn',
environment: process.env.NODE_ENV,
integrations: [
browserTracingIntegration(),
replayIntegration(),
feedbackIntegration,
thirdPartyErrorFilterIntegration({
filterKeys: ['our-app'],
behaviour: 'drop-error-if-contains-third-party-frames',
}),
],
})Steps to Reproduce
- install @sentry/react 8.15.0, @sentry/webpack-plugin 2.20.1
- Set up
thirdPartyErrorFilterIntegrationaccording to the docs: https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-thirdpartyerrorfilterintegration, so:
Sentry.init({
debug: true,
dsn: 'our-dsn',
environment: process.env.NODE_ENV,
integrations: [
browserTracingIntegration(),
replayIntegration(),
feedbackIntegration,
thirdPartyErrorFilterIntegration({
filterKeys: ['our-app'],
behaviour: 'drop-error-if-contains-third-party-frames',
}),
],
})and in webpack.config.js:
module.exports = {
//...
plugins: [
//...
sentryWebpackPlugin({
applicationKey: 'our-app',
}),
]
}- run webpack dev server (
cross-env NODE_ENV=development node ./node_modules/webpack/bin/webpack.js serve) - Throw an error from the application upon clicking a button (simple
throw Error("my test")in the button’s onClick event handler)
Expected Result
Since the error originates in the application code, it should get logged to Sentry.
Actual Result
The error doesn’t get logged to Sentry.
I can see the following logs in the browser console:
logger.js:83 Sentry Logger [log]: Event processor "ThirdPartyErrorsFilter" dropped event
logger.js:83 Sentry Logger [log]: Adding outcome: "event_processor:error"
logger.js:83 Sentry Logger [log]: An event processor returned `null`, will not send event.
When browsing webpack’s memory bundle, I can see the following at the top of the bundled files, so I guess the "our-app" tag seems to get added there, however Sentry still thinks the error originates from 3rd party code for some reason?
;!function() {
try {
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}
, n = (new Error).stack;
n && (e._sentryDebugIds = e._sentryDebugIds || {},
e._sentryDebugIds[n] = "13ccde7e-de46-4869-8226-5fcff381b6d8",
e._sentryDebugIdIdentifier = "sentry-dbid-13ccde7e-de46-4869-8226-5fcff381b6d8")
} catch (e) {}
}();
{
var _sentryModuleMetadataGlobal = typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
_sentryModuleMetadataGlobal._sentryModuleMetadata = _sentryModuleMetadataGlobal._sentryModuleMetadata || {};
_sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack] = Object.assign({}, _sentryModuleMetadataGlobal._sentryModuleMetadata[new Error().stack], {
"_sentryBundlerPluginAppKey:our-app": true
});
}
var _global = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
_global.SENTRY_RELEASE = {
id: "c3b47313407c1a6fc02ab0547364ecf384c5dfe4"
};
// other code continues
Note: I haven’t tried whether this works with the production bundle, only with the dev server.
Metadata
Metadata
Assignees
Labels
Package: reactIssues related to the Sentry React SDKIssues related to the Sentry React SDK
Projects
Status
Waiting for: Product Owner