Skip to content

Static site rendering not working on Vercel when ssr: true #14281

@titouv

Description

@titouv

Reproduction

https://github.com/titouv/react-router-repro-static-issue

Steps:

  1. Deploy on vercel
  2. Open a new page on the root url with the vercel deployment url deployed
  3. Check the logs and see if the request has been handled by a CDN or a function invocation

Used Package Manager

bun

Expected Behavior

From my understanding, a React Router project should be able to combine static site rendering on some pages and server-side rendering on others (or for API routes). The page handling should be made by a CDN, not a function invocation, because of the prerendering

Actual Behavior

I am experiencing a request on a static site rendered path to execute a Vercel Function Invocation while it should not, it should directly be handled by the CDN

Here are two screenshots from the Build Summary and the log from function invocation

From my understanding, the static site rendering worked, but it's just not used

Image Image (this second image seems to be the correct state since there is pre-rendered assets presets in the output builds, but they are not used)

Static site serving from CDN seems to work when ssr: false (which is not possible in my case because of an API route).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions