Skip to content

Module '"@sentry/nextjs"' has no exported member 'CaptureContext' and no exported member '"ExclusiveEventHintOrCaptureContext"'. #18503

@RoyBkker

Description

@RoyBkker

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

10.30.0

Framework Version

15.5.9

Link to Sentry event

No response

Reproduction Example/SDK Setup

import type { CaptureContext, ExclusiveEventHintOrCaptureContext } from "@sentry/nextjs";
import { captureException, captureMessage, flush, type SeverityLevel } from "@sentry/nextjs";

export async function captureExceptionAndFlush(
  error: unknown,
  context?: ExclusiveEventHintOrCaptureContext,
  timeout = 2000
): Promise<void> {
  captureException(error, context);
  await flush(timeout);
}
export async function captureMessageAndFlush(
  message: string,
  captureContext?: CaptureContext | SeverityLevel,
  timeout = 2000
): Promise<void> {
  captureMessage(message, captureContext);
  await flush(timeout);
}

Steps to Reproduce

See the Typescript errors when importing.

Module '"@sentry/nextjs"' has no exported member 'ExclusiveEventHintOrCaptureContext'.ts(2305)
Module '"@sentry/nextjs"' has no exported member 'CaptureContext'.ts(2305)

Expected Result

Can import the Types

Actual Result

Image

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions