Skip to content

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

Closed

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.

Activity

  1. linear commented on Dec 15, 2025

    @linear
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Dec 15, 2025
  3. self-assigned this
    on Dec 15, 2025
  4. chargome commented on Dec 15, 2025

    @chargome
    Member

    Hey @RoyBkker thanks for reaching out!

    You're right that we do not export these types atm.

    Would something like :

    // infer parameter type 
    type CaptureExceptionContext = Parameters<typeof captureException>[1];

    also work fo you?

  5. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Dec 15, 2025
  6. github-actions commented on Dec 16, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #18509, which was included in the 10.31.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions