Skip to content

d.thirdPartyErrorFilterIntegration is not a function occurs in nextjs project #15290

@ranlix

Description

@ranlix

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.47.0

Framework Version

Next 14.2.14

Link to Sentry event

No response

Reproduction Example/SDK Setup

// next.config.js
export default withSentryConfig(nextConfig, {
  unstable_sentryWebpackPluginOptions: {
    applicationKey: "my-app",
  },

  org: "my-org",
  project: "my-project",

  silent: !process.env.CI,
  authToken: process.env.SENTRY_AUTH_TOKEN,

  widenClientFileUpload: true,
  reactComponentAnnotation: {
    enabled: true,
  },
  hideSourceMaps: true,
  disableLogger: true,
  automaticVercelMonitors: true,
}),
// sentry.client.config.ts
Sentry.init({
  dsn: "MY_DSN,

  // Add optional integrations for additional features
  integrations: [
    Sentry.replayIntegration(),
    Sentry.thirdPartyErrorFilterIntegration({
      filterKeys: ["my-app"],
      behaviour: "drop-error-if-exclusively-contains-third-party-frames",
    }),
  ],
  tracesSampleRate: 1,
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
  debug: false,
  ignoreErrors: [
    "incomplete-app-router-transaction",
    "chrome-extension://",
    "edge-extension://",
    "window.onerror",
  ],
  beforeSend(event) {
    if (
      event.request?.url?.includes("chrome-extension://") ||
      event.request?.url?.includes("edge-extension://")
    ) {
      event.tags = { ...event.tags, source: "browser-extension" };
      return null;
    }
    return event; 
  },
});

Steps to Reproduce

  1. run npm run build;
  2. run npm run start;
  3. visit http://localohost:3000

Expected Result

website works normally

Actual Result

an error occurs:

Failed to prepare server TypeError: An error occurred while loading instrumentation hook: d.thirdPartyErrorFilterIntegration is not a function

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugPackage: browserIssues related to the Sentry Browser SDK

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions