Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
📊 Package size report 0.05%↑
Unchanged files
🤖 This report was automatically generated by pkg-size-action |
…gistered Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pieh
force-pushed
the
pieh/otel-cache-components-prerender
branch
from
August 2, 2026 18:35
6b8314c to
8134daf
Compare
The `ppr` fixture declares `test.dependencies.next: "canary || >=16.0.0"`, so on next@15 it is never installed or built. The Cache Components + OpenTelemetry tests were only gated on their own feature checks, so there they would fail on a missing build rather than skip. Wrap the file in a single `describe.skipIf` carrying the version guard that was previously inline on the one test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pieh
marked this pull request as ready for review
August 3, 2026 08:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Next.js only installs its Cache Components tracer patch when the app has an instrumentation.ts exporting register — that's the only place afterRegistration() is called. Our Functions bootstrap registers an OpenTelemetry SDK outside that hook, so on sites without an
instrumentation.tsthe tracer stays unpatched.An unpatched tracer creates spans inside the active
workUnitAsyncStoragecontext. Generating a span id callsMath.random(), which Next instruments under cacheComponents to treat as synchronous platform IO — seeing a work unit store, it aborts the surrounding prerender. Next's patch wrapsstartSpan/startActiveSpaninworkUnitAsyncStorage.exit()so span creation happens outside that context; the id is still random, it just no longer registers as IO against the prerender.The failure is silent: the page still renders, but the runtime-prefetch payload that seeds the client segment cache is dropped from the initial HTML, so navigations refetch content that should already have been seeded.
Documentation
Tests
Added some integration test for behavior (inspired by setup used by one of Next.js repo e2e tests) and if patch still works correctly (and moved existing ppr related integration test to dedicated ppr test file)
This was originally found when running Next.js e2e test suite (fixes ~40 e2e test failures there)
Relevant links (GitHub issues, etc.) or a picture of cute animal