redirect in server action to an API route handler triggers a fetch of RSC payload
Unanswered
Atlantic cod posted this in #help-forum
Atlantic codOP
Hey there, we have a bit of a weird issue.
I have a page which submits a server action. That server action makes an API call, then redirects the browser in the server action to the
The issue I'm seeing is that NextJS is sending a request to the redirect URL with a
It seems as though
For context, we're on Next 14.
I can provide more insight if needed, but because this is a company code base I can't share the exact reproduction. Hoping there's an easy workaround for this before I go attempt to make one!
Thanks!
I have a page which submits a server action. That server action makes an API call, then redirects the browser in the server action to the
location that's returned by the API call. The redirect is done with the redirect function in NextJS inside the server action.The issue I'm seeing is that NextJS is sending a request to the redirect URL with a
.rsc extension.It seems as though
redirect prefetches the RSC payload, even though the URL that's being redirected to is a route handler, not a page.For context, we're on Next 14.
I can provide more insight if needed, but because this is a company code base I can't share the exact reproduction. Hoping there's an easy workaround for this before I go attempt to make one!
Thanks!