Static site rendering not working on Vercel when ssr: true

This is related to the package @vercel/react-router and/or the deployment pipeline related to react-router project on Vercel.

I previously open this issue on the react-router repo and its be closed as not a direct react-router issue. Here is the issue link

Reproduction

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

(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).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.