More descriptive error/documentation for "An unexpected response was received from the server" in Next 16.x #89607
oneillsp96
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
I recently debugged an error for several hours where we had multiple server actions being called sequentially, each performing "revalidateTag"
I believe what was happening was that with each server action, Next.js was trying to reconcile the state of the app. But it was changing so quickly that at some point, Next.js says, screw it, I give up and returns this error:
"An unexpected response was received from the server."
It would be great if the Next team could either document or incorporate into the codebase some better explanation as to what is causing this error and specifically documenting the case that I ran into with sequential server actions causing it.
Alternatively, it might be nice to actually fix this bug since it only appeared after upgrading from next14.x to next16.x.
Non-Goals
No response
Background
I think this feature is needed because the error that is returned is currently very opaque. It almost seemed to suggest an issue with the middleware (proxy.ts) corrupting the response from the server action when that wasn't really the case.
Proposal
ideally something in the code itself would be able to detect an issue like this and warn the user. However documentation would also be sufficient.
Beta Was this translation helpful? Give feedback.
All reactions