It appears that Next.js was dropping the second queued action in my case. I’m using Next.js v15.2.0-canary.61, and this behavior might be fixed in a newer version.
I found a workaround in a GitHub thread that resolves the issue. The suggestion is to wrap the server action call in a setTimeout
, which successfully prevents the second action from being lost.
This approach worked for me:
setTimeout(() => {
yourServerAction();
}, 0);
If upgrading isn’t an option or the issue persists, this workaround might help others facing the same problem.