Skip to content

Attempted import error: 'extraErrorDataIntegration' is not exported from '@sentry/nextjs' (imported as 'Sentry'). #12307

@Saturate

Description

@Saturate

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

8.2.1

Framework Version

14.2.2

Link to Sentry event

No response

SDK Setup

import * as Sentry from '@sentry/nextjs';

export async function register() {
  const shared: Parameters<typeof Sentry.init>[0] = {
    dsn: 'https://...........',

    // Adjust this value in production, or use tracesSampler for greater control
    tracesSampleRate: 1,

    release: process.env.NEXT_PUBLIC_VERSION_TAG,

    // Set readable environment name
    environment: process.env.BUILD_ID?.replace('-build', ''),

    // Setting this option to true will print useful information to the console while you're setting up Sentry.
    debug: false,
    
    integrations: [Sentry.extraErrorDataIntegration({ depth: 10, captureErrorCause: true })],
  };

  if (process.env.node_env !== 'development') {
    if (process.env.NEXT_RUNTIME === 'nodejs') {
      Sentry.init({
        ...shared,
      });
    }

    if (process.env.NEXT_RUNTIME === 'edge') {
      Sentry.init({
        ...shared,
      });
    }
  }
}

Steps to Reproduce

  1. Run pnpm dev

Expected Result

Being able to use integrations: [Sentry.extraErrorDataIntegration({ depth: 10, captureErrorCause: true })], on server side as well to get better errors.

Actual Result

Errors in console with:

storefront:dev:   ./instrumentation.ts
storefront:dev: Attempted import error: 'extraErrorDataIntegration' is not exported from '@sentry/nextjs' (imported as 'Sentry').
storefront:dev:   Compiled in 1431ms (920 modules)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: browserIssues related to the Sentry Browser SDK

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions