fix: replace docs/canary links with stable docs paths in error messages - #92528
Conversation
The "use cache" directive error and after() API error messages pointed to /docs/canary/... instead of /docs/..., creating confusing links on canary builds. Updated all occurrences to use the stable docs path. Made-with: Cursor
There was a problem hiding this comment.
Pull request overview
Updates user-facing error message links for the "use cache" directive and after()-related request APIs to point at stable Next.js docs paths (/docs/...) instead of canary (/docs/canary/...).
Changes:
- Updated
after()misuse error messages incookies(),headers(), andconnection()to link tohttps://nextjs.org/docs/app/api-reference/functions/after. - Updated the
"use cache"feature-flag error message to link tohttps://nextjs.org/docs/app/api-reference/directives/use-cache#usage. - Updated
packages/next/errors.jsonentries and Rust transform test stderr fixtures to match the new URLs.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/next/src/server/request/headers.ts | Switches after() error message link from canary to stable docs. |
| packages/next/src/server/request/cookies.ts | Switches after() error message link from canary to stable docs. |
| packages/next/src/server/request/connection.ts | Switches after() error message link from canary to stable docs. |
| packages/next/errors.json | Updates error-code message mappings to use stable docs links. |
| crates/next-custom-transforms/src/transforms/server_actions.rs | Updates "use cache" feature-flag error link to stable docs. |
| crates/next-custom-transforms/tests/errors/use-cache-not-allowed/1/output.stderr | Updates expected stderr fixture URL for "use cache" error. |
| crates/next-custom-transforms/tests/errors/use-cache-not-allowed/2/output.stderr | Updates expected stderr fixture URL for "use cache: x" error. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Tests Passed |
Merging this PR will not alter performance
Comparing Footnotes
|
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
What?
Error messages for the
"use cache"directive andafter()API (incookies(),headers(),connection()) pointed to/docs/canary/...instead of/docs/....Why?
On canary builds,
docs/canarylinks can create circular or confusing references. These APIs are stable and their docs live at the standard/docs/app/...path.How?
Replaced all
nextjs.org/docs/canary/URLs withnextjs.org/docs/in:crates/next-custom-transforms/src/transforms/server_actions.rs— the"use cache"feature flag errorcrates/next-custom-transforms/tests/errors/use-cache-not-allowed/1/output.stderrand2/output.stderr— matching test fixturespackages/next/src/server/request/cookies.ts,headers.ts,connection.ts—after()errorspackages/next/errors.json— compiled error message index (6 occurrences)