Skip to content

nextjs: fetch() rejects after prerender completes on cacheComponents route with no dynamic data access (HANGING_PROMISE_REJECTION) #23592

Description

@kevbarns

SDK

@sentry/nextjs 10.70.0 (upgraded from 10.23.0)

Framework

Next.js 16, cacheComponents: true

Observed in production

Route /rdva (no dynamic segment accessed when hit without query params) started throwing this error repeatedly in Sentry, first seen ~10h after upgrading @sentry/nextjs 10.23.0 → 10.70.0, still escalating 3 days later (10k+ occurrences, handled: yes, no reported user impact — traffic is a crawler bot hitting the bare route with no query params):

Error: During prerendering, fetch() rejects when the prerender is complete. Typically these errors are handled by React but if you move fetch() to a different context by using setTimeout, after, or similar functions you may observe this error and you should handle it in that context. This occurred at route "/rdva".

digest: HANGING_PROMISE_REJECTION

Stack trace goes through a Sentry trace wrapper in the SSR chunk before reaching Next's internal fetch/tracing frames, which is why I suspect Sentry's own instrumentation rather than application code — but I have not isolated a minimal repro yet.

What I've checked so far

Reproduction

Not yet isolated to a minimal repro — will update if I manage to reduce it. Posting in case others hit the same digest, since the closest match I found (#21333) turned out to be a different root cause.

Activity

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