Skip to main content

[JavaScript] Why is thirdPartyErrorFilterIntegration not filtering errors from outside my application?

Issue

I use thirdPartyErrorFilterIntegration with behaviour: "drop-error-if-exclusively-contains-third-party-frames", but errors that look like they come from outside my app still reach Sentry.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • JavaScript browser SDKs

  • thirdPartyErrorFilterIntegration

  • Error Monitoring

Resolution

That behaviour only drops an error when every stack frame is third-party (unmarked). If any frame is marked as your application code, the SDK keeps the event.

Bundled dependencies often count as first-party. When your bundler builds the app, Sentry’s bundler plugin marks modules with your applicationKey. Frames from bundled node_modules can receive that mark too, so the exclusive-drop mode does not treat them as third-party.

  1. Confirm your bundler plugin applicationKey matches filterKeys in thirdPartyErrorFilterIntegration.

  2. Inspect the event stack trace. If any frame is marked first-party, exclusive-drop mode will not drop the event.

  3. If you need stricter filtering, use one of these options:

  • Switch behaviour to drop-error-if-contains-third-party-frames if you want to drop events that include any third-party frame.

  • Use beforeSend to inspect and drop events with custom logic.

  • Use allowUrls and/or denyUrls to filter by script URL in the stack trace.

See the JavaScript filtering documentation for thirdPartyErrorFilterIntegration, beforeSend, allowUrls, and denyUrls.

Did this answer your question?