AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Server Action Passed As Argument Fails After Navigation Because Per-Page Decode Map Omits Retained Action

When a client stashes a server action from route /a and later calls an action from /b with that stashed action as an argument, Next.js decodes the outer action locally but uses a server module map limited to /b, so decoding the inner action reference fails with "Failed to find Server Action".

highConfidence 72%Next.jsAffected V16.3.0-Canary.102

Origin Analysis

Next.js builds per-page server reference module maps; decodeReply() for locally executed actions is given only the current page's map, so a retained action reference from another route cannot be revived even though its manifest entry exists.
pnpm install && pnpm dev; open /a, click 'Save action A'; navigate client-side to /b; click 'Run action B with saved action A'; observe 500 error with digest '370130379@E974'.

Fixing Code Block

Edge Case Audit

Using the first available worker for an action not reachable from the current page may run that action in a different worker context than its original page. If an action imports page-specific server modules or relies on route-local bundling, behavior could differ. This patch also increases the number of module references loaded for each local action decode. Rollback: remove the augmentation and instead statically import the retained action in the page that receives it as an argument.

Ecosystem Topology