136979fedb
### What When submitting a server action on a page that doesn't import the action handler, a "Failed to find server action" error is thrown, even if there's a valid handler for it elsewhere. ### Why Workers for a particular server action ID are keyed by their page entrypoints, and the client router invokes the current page when triggering a server action, since it assumes it's available on the current page. If an action is invoked after the router has moved away from a page that can handle the action, then the action wouldn't run and an error would be thrown in the server console. ### How We try to find a valid worker to forward the action to, if one exists. Otherwise it'll fallback to the usual error handling. This also adds a header to opt out of rendering the flight tree, as if the action calls a `revalidate` API, then it'll return a React tree corresponding with the wrong page. Fixes #61918 Fixes #63915 Closes NEXT-2489 |
||
---|---|---|
.. | ||
catching-error | ||
client | ||
client-static | ||
delayed-action | ||
dynamic-csr | ||
encryption | ||
error-handling | ||
file | ||
form | ||
handler | ||
header | ||
interception-routes | ||
mutate-cookie | ||
no-caching-in-actions | ||
redirect-target | ||
redirects | ||
revalidate | ||
revalidate-2 | ||
revalidate-multiple | ||
server | ||
shared | ||
test | ||
use-transition | ||
layout.js | ||
not-found.js |