Double RSC fetch after server action redirect #66166
Labels
bug
Issue was opened via the bug report template.
locked
Navigation
Related to Next.js linking (e.g., <Link>) and navigation.
Link to the code that reproduces this issue
https://github.com/cfrank/next.js
To Reproduce
pnpm i
pnpm build
NEXT_TEST_SKIP_CLEANUP=1 pnpm test-start test/e2e/app-dir/actions/app-action.test.ts
/tmp/next-install-*
)pnpm next
Current vs. Expected behavior
Currently when performing a redirect within a server action we are correctly resolving the RSC bundle within the
POST
request and performing the client side redirect to the destination path. But upon loading the destination path we are performing a subsequent fetch of the destination path:Provide environment information
Which area(s) are affected? (Select all that apply)
Navigation
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local), Other (Deployed)
Additional context
I encountered this bug while working on #64604 where I added more robust tests to verify that only a single request was being made during server action redirects. When I opened the PR the tests were passing and only a single POST request was being made with all relevant data being shipped within that single request, but shortly after a change was landed which introduced this second request.
The text was updated successfully, but these errors were encountered: