-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Description
Reproduction
https://github.com/titouv/react-router-repro-static-issue
Steps:
- Deploy on vercel
- Open a new page on the root url with the vercel deployment url deployed
- 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).