Replies: 2 comments 1 reply
-
|
I don't think this was intended to work in the first place as it's loading Alternatively, // 3rd file: ssg.tsx
import { renderToString } from "react-dom/server";
import { StaticRouter } from "react-router";
import AppRoutes from "./AppRoutes.tsx";
export function mySsg() {
return renderToString(
<StaticRouter location={path} >
<AppRoutes />
</StaticRouter>,
)
}and execute const { mySsg } = ssrLoadModule("./src/ssg.tsx")
const html = mySsg(); |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Thank you @hi-ogawa That got me unstuck! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to do server-side generating (SSG) using vite (v7) and react-router (v7).
This used to work, in vite v6:
The
src/AppRoutes.tsxlooks like this:That used to work but since I upgrade from vite 6, to vite 7, I now get this error:
Beta Was this translation helpful? Give feedback.
All reactions