mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #976] [MERGED] fix: forward invalid dynamic usage errors on client-side navigations in dev #998
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#998
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/976
Author: @Divkix
Created: 4/30/2026
Status: ✅ Merged
Merged: 4/30/2026
Merged by: @james-elicx
Base:
main← Head:fix/958-dynamic-usage-errors-client-nav📝 Commits (2)
bb31e5afix: forward invalid dynamic usage errors on client-side navigations in dev (#958)3b33d37refactor: extract _recordInvalidDynamicUsageError helper in server.ts📊 Changes
7 files changed (+223 additions, -12 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+2 -1)📝
packages/vinext/src/server/app-page-render.ts(+82 -1)📝
packages/vinext/src/shims/headers.ts(+41 -2)📝
packages/vinext/src/shims/server.ts(+22 -2)📝
packages/vinext/src/shims/unified-request-context.ts(+1 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+12 -6)📝
tests/shims.test.ts(+63 -0)📄 Description
Fixes #958
Summary
throwIfInsideCacheScope()on the per-request context so they survive user-codetry/catchand can surface on client-side navigationsconsole.errorconsumeInvalidDynamicUsageError()tonext/headersfor consuming the recorded error_throwIfInsideCacheScopeinserver.ts(used byafter()) with the same recording behaviorPorted from Next.js: vercel/next.js@f5e54c0 (#93184)
Test plan
tests/shims.test.ts:consumeInvalidDynamicUsageErrorreturns null when no error recordedconsumeInvalidDynamicUsageErrorworks outside unified request scope🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.