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 |
||
---|---|---|
.. | ||
app | ||
components | ||
pages | ||
app-action-export.test.ts | ||
app-action-form-state.test.ts | ||
app-action-progressive-enhancement.test.ts | ||
app-action-size-limit-invalid.test.ts | ||
app-action.test.ts | ||
middleware.js | ||
next.config.js |