sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

All Errors Being Marked as Third Party in NextJS with thirdPartyErrorFilteringIntegration enabled

Open kerenkhatiwada opened this issue 6 months ago • 3 comments

Is there an existing issue for this?

  • [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
  • [x] I have reviewed the documentation https://docs.sentry.io/
  • [x] 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/nextjs

SDK Version

8.24.0

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

No response

Steps to Reproduce

After configuring the thirdPartyErrorFilterIntegration to apply a tag to issues if they contain third-party stack frames, issues are incorrectly tagged as being from a third party.

  1. Add applicationKey to next.config.js and add the thirdPartyErrorFilterIntegration to Sentry.init() next.config.js
export default withSentryConfig(nextConfig, {
 
  applicationKey: "SentryKeyWithoutThirdParty",

});

Sentry.client.config.js

Sentry.init({
 
  integrations: [

    Sentry.thirdPartyErrorFilterIntegration({
      filterKeys: ["SentryKeyWithoutThirdParty"],
      behaviour: "apply-tag-if-contains-third-party-frames",

    }),
  ],

});
  1. build and run the Next.js app
  2. observe issues, always have the third_party_code tag set as true

https://org2-w7.sentry.io/issues/5615320176/events/33b552bfbbd8422db76734d93203f883/ https://org2-w7.sentry.io/settings/projects/nextjs14/source-maps/artifact-bundles/ff407422-2b74-5662-84b7-a70ebdde9fd3/?query=306f2601-113c-4fb2-9666-d8fe6b89d8e3 same result with behaviour: "apply-tag-if-exclusively-contains-third-party-frames"

Additional info: window._sentryModuleMetadata is undefined: Image

When behaviour is set to behaviour: "drop-error-if-contains-third-party-frames" events are dropped: Image

Expected Result

third_party_code tag is set to False or not at all for errors occurring in my app

Actual Result

third_party_code tag is set as True for errors occurring in my app

kerenkhatiwada avatar Aug 08 '24 19:08 kerenkhatiwada