Repository navigation
fix(proxy): bypass next-intl for RSC and server-action requests - #475
Merged
Merged
Conversation
Soft navigations to /dashboard/prompts (e.g. sidebar Visibility -> Prompts) still froze after #474: the navigation's RSC request carries the router state tree through the intl middleware and intermittently dies server-side with 'The router state header was sent but could not be parsed' (captured in Vercel function logs; known framework issue for broad proxy matchers on Vercel, vercel/next.js#91723). The failed transition then blocks the client's queued server actions, so the page's data fetch never dispatches. With a single 'en' locale the only thing next-intl's middleware does for these requests is the /en rewrite — do that manually for any request carrying an RSC or Next-Action header and skip the intl machinery entirely. Auth checks still run first; supabase session cookies are still forwarded. Document requests (no RSC header) keep going through next-intl unchanged.
7 of 12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Soft navigations to the Prompts page (e.g. sidebar Visibility → Prompts) still froze after #474. Verified chain:
Error: The router state header was sent but could not be parsed— captured in Vercel function logs; a known framework-level issue for apps with a broad proxy matcher on Vercel (App Router _rsc navigations intermittently fail with "The router state header was sent but could not be parsed" when Proxy matcher is broad on Vercel vercel/next.js#91723). fix(prompts): shallow-update tab/sort URL params instead of router.replace #474 removed the page's own mount-time trigger, but any navigation INTO the page is still an RSC request and can hit the same bug.Per the upstream issue, the failures disappear when the middleware stops processing these requests. With a single
'en'locale, the only thing next-intl's middleware does for them is the/enrewrite — so for any request carrying anRSCorNext-Actionheader, do that rewrite manually and skip the intl machinery entirely. Auth checks (Supabase session, protected-route redirect) still run first, and session cookies are still forwarded on the response. Document requests (no RSC header) keep flowing through next-intl unchanged.Related issue
Second half of the urgent "prompts page never loads" fix (#474 was the first). Upstream: vercel/next.js#91723.
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
/dashboard/visibility(Insights), click Prompts in the sidebar repeatedly — the table must load every time; no request in the Network tab may return 500/503./dashboard/prompts?tab=all— loads normally./enrewrite) still works, sign-in/sign-out unaffected.Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)