-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
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
- Follow the official manual setup guide
- Add to
instrumentation-client.ts:import * as Sentry from "@sentry/nextjs"; export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
- Run a linter with
import/namespacerule (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.tsexportscaptureRouterTransitionStartbuild/types/index.types.d.tsdoes 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
No status