Triggering delayed server actions after page navigation is broken #61918
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
locked
Link to the code that reproduces this issue
https://github.com/mordechaim/delayed-server-actions
To Reproduce
/page
Current vs. Expected behavior
A very common paradigm before submitting data to the server is to preprocess the data client-side. But if the user navigates away while the server action has not yet been triggered, the following error is emitted in the server console:
On the browser Network tab I can clearly see the wrong endpoint being called. In the case of the reproduction above, the request URL is
http://localhost:3000/page
instead ofhttp://localhost:3000
.I tried both importing the action inside a client component or importing in a server component as passing the action as props to a client component; the results are identical.
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response
NEXT-2489
The text was updated successfully, but these errors were encountered: