You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With ai/rsc the post requests go to the same route and the AIState is send as part of the server action form header. As a conversation grows long and there is a lot of metadata, this can make the headers quite large.
Since many apps like ours use middleware for critical functions like authentication, this causes errors. I believe as of next 14.1, server actions go through middleware by default and this is causing this to happen often:
While I realize this error isn't specific to ai/rsc, the way the library works to wrap server actions with the AIState in each request causes this in our case. I assume many people will run into this problem.
I believe the fix is to add next-action to the missing header.
We moved our implementation to the rsc library, which was a good amount of work but pushed a lot of logic to the server. But this caused us to have to revert before moving to production.
Should this directly be addressed in the docs or a code change?
Code example
No response
Additional context
We also use fairly large URLs to represent state and because next includes the router history in headers, the 2 add up to cause problems. Even when removing this we still ran into problems with large message history and metadata.
The text was updated successfully, but these errors were encountered:
Description
With ai/rsc the post requests go to the same route and the AIState is send as part of the server action form header. As a conversation grows long and there is a lot of metadata, this can make the headers quite large.
Since many apps like ours use middleware for critical functions like authentication, this causes errors. I believe as of next 14.1, server actions go through middleware by default and this is causing this to happen often:
While I realize this error isn't specific to ai/rsc, the way the library works to wrap server actions with the AIState in each request causes this in our case. I assume many people will run into this problem.
I believe the fix is to add next-action to the missing header.
We moved our implementation to the rsc library, which was a good amount of work but pushed a lot of logic to the server. But this caused us to have to revert before moving to production.
Should this directly be addressed in the docs or a code change?
Code example
No response
Additional context
We also use fairly large URLs to represent state and because next includes the router history in headers, the 2 add up to cause problems. Even when removing this we still ran into problems with large message history and metadata.
The text was updated successfully, but these errors were encountered: