Skip to content

RSC mode lacks version skew detection (non-RSC mode has it since v7.3) #14849

Open

Description

@agcty

I know RSC is still unstable_ -- this is just for tracking, not a demand for immediate action.

The non-RSC framework mode detects version mismatches via X-Remix-Reload-Document on /__manifest requests and triggers a full page reload with sessionStorage loop prevention (added in #13061). The RSC code path has none of this.

When a new deployment happens while a user has a stale client loaded, any client-side navigation fetches an RSC stream the old client can't decode. createFromReadableStream fails and the catch block at dom-export.js:632 throws the generic "Unable to decode RSC response" -- no recovery, no reload, just a broken page.

The RSC fetchAndApplyManifestPatches (dom-export.js:880-908) doesn't send a version param or check for X-Remix-Reload-Document. The manifest has a hardcoded version: "1".

We're working around this by passing a custom fetch to RSCHydratedRouter and createCallServer that adds a version header, and checking it server-side. It works, but it's the kind of thing that should live in the framework.

For reference, the non-RSC mode already handles this well -- it would be great to see the same treatment for RSC navigations, manifest patches, and server actions.

Activity

  1. deleted a comment from Mishra-coder on Mar 20, 2026
  2. jacob-ebey commented on Mar 21, 2026

    @jacob-ebey
    Member

    I've been contemplating adding a versioning system that differs from the existing mechanism. With RSC and some cleaver chunking we have the opportunity to allow for "no client reload required deployments". This may have to be an opt-in, as it would require that the compiler know of any deps that require a "singleton" (React, RR, any lib that uses React.createContext()), but if we do know this and those are unchanged, the client can continue to operate against the new deployed backend without a reload.

    Do you have thoughts here @agcty?

  3. self-assigned this
    on Mar 21, 2026
  4. agcty commented on Mar 26, 2026

    @agcty
    ContributorAuthor

    @jacob-ebey If that's possible I think that'd be pretty cool! How would that work technically? Hooking into vite and analyzing the graphs? Or do you mean opt-in as a manual configuration option?

    One of the problems I have with RSC is that it's very easy for deps to end up in the wrong graph. For many third-party packages, the only reliable boundary signal is still "use client" at a module's entry, if a client-only package doesn't declare it, a server component can import it and nothing catches it. We added export condition guards to our workspace packages ("browser": null on server-only packages, "react-server": null on client-only packages) which helps, but third-party packages generally don't have these.

    Separately, we also found that Vite's client optimizeDeps scanner prebundles server-only dependencies (~730 KB of drizzle-orm, bcryptjs, etc.) because it scans route files before the RSC virtual module transform splits them. Filed that as #14934.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions