Skip to content

Next.js: Client Instrumentation Hook - Slow execution detected #16093

@FabianKoder

Description

@FabianKoder

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

9.13.0

Framework Version

Next 15.3.0

Link to Sentry event

No response

Reproduction Example/SDK Setup

As documented;

instrumentation-client.ts

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

Sentry.init({
	dsn: process.env.NC_SENTRY_DSN,
});

(real config has more integrations enabled, but this basically empty config already has at least 100ms of initialization time which causes the warning)

Steps to Reproduce

  1. Added Sentry.init as documented in the instrumentation-client.ts file
  2. Get warning on every page load in development mode that instrumentation init takes 100-300ms which, according to Next.js, can cause lag if it takes longer than 16ms (1 Frame @ 60fps)

Expected Result

Fast initialization without impacting user experience

Actual Result

[Client Instrumentation Hook] Slow execution detected: 350ms (Note: Code download overhead is not included in this measurement)

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Product Owner

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions