Skip to content

captureRouterTransitionStart missing from index.types.d.ts — linters report 'not found in namespace' #19939

@sugurutakahashi-1234

Description

@sugurutakahashi-1234

Description

captureRouterTransitionStart is exported from the browser condition entry point (index.client.js), but is not included in the types condition entry point (index.types.d.ts).

This causes ESLint import/namespace rules (e.g., oxlint) to report:

"captureRouterTransitionStart" not found in imported namespace "@sentry/nextjs"

The function works correctly at runtime because the browser bundler resolves the browser condition. However, static analysis tools resolve the types condition and cannot find the export.

Steps to Reproduce

  1. Follow the official manual setup guide
  2. Add to instrumentation-client.ts:
    import * as Sentry from "@sentry/nextjs";
    export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
  3. Run a linter with import/namespace rule (e.g., oxlint, eslint-plugin-import)

Expected Behavior

No lint error — captureRouterTransitionStart should be found in the @sentry/nextjs namespace.

Actual Behavior

"captureRouterTransitionStart" not found in imported namespace "@sentry/nextjs"

Root Cause

In @sentry/nextjs/package.json exports:

Condition Entry Point Has captureRouterTransitionStart?
types index.types.d.ts ❌ No
browser index.client.js ✅ Yes
node index.server.js ❌ No (expected)

The types entry should include client-only exports so that static analysis tools can resolve them.

Verified in @sentry/nextjs@10.43.0:

  • build/types/client/index.d.ts exports captureRouterTransitionStart
  • build/types/index.types.d.ts does not re-export it

Environment

  • @sentry/nextjs: 10.43.0
  • Linter: oxlint 1.51.0
  • Next.js: 16.1.6
  • Runtime: Bun 1.3.11

Metadata

Metadata

Assignees

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions