You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to prerender some routes like terms, privacy, about-us. But when I setup react-router.config.ts I got an error on building.
I just npx create-react-router@latest and change react-router.config.ts like this:
import type { Config } from "@react-router/dev/config";
export default {
// Config options...
// Server-side render by default, to enable SPA mode set this to `false`
ssr: true,
async prerender() {
return ["/"];
},
} satisfies Config;
It is happen on StackBlitz too
The error with default template
x Build failed in 85ms
[react-router] Prerender: Received a 500 status code from `entry.server.tsx` while prerendering the `/` path.
Unexpected Server Error
at validatePrerenderedResponse (/Users/gustavo/repos/estudos/js/rr-default/node_modules/@react-router/dev/dist/vite.js:2635:11)
at prerenderRoute (/Users/gustavo/repos/estudos/js/rr-default/node_modules/@react-router/dev/dist/vite.js:2599:3)
at handlePrerender (/Users/gustavo/repos/estudos/js/rr-default/node_modules/@react-router/dev/dist/vite.js:2525:7)
at Object.handler (/Users/gustavo/repos/estudos/js/rr-default/node_modules/@react-router/dev/dist/vite.js:2029:13)
at async Promise.all (index 0)
at PluginDriver.hookParallel (file:///Users/gustavo/repos/estudos/js/rr-default/node_modules/rollup/dist/es/shared/node-entry.js:20740:9)
at file:///Users/gustavo/repos/estudos/js/rr-default/node_modules/rollup/dist/es/shared/node-entry.js:21783:13
at catchUnfinishedHookActions (file:///Users/gustavo/repos/estudos/js/rr-default/node_modules/rollup/dist/es/shared/node-entry.js:21158:16)
at Module.build (file:///Users/gustavo/repos/estudos/js/rr-default/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:65449:16)
at viteBuild (/Users/gustavo/repos/estudos/js/rr-default/node_modules/@react-router/dev/dist/cli/index.js:1204:5) {
code: 'PLUGIN_ERROR',
plugin: 'react-router',
hook: 'writeBundle'
}
The error with cloudflare template
x Build failed in 429ms
[react-router] Cannot convert undefined or null to object
at Function.values (<anonymous>)
at groupRoutesByParentId2 (/Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/@react-router/dev/dist/vite.js:2650:10)
at createPrerenderRoutes (/Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/@react-router/dev/dist/vite.js:2661:76)
at handlePrerender (/Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/@react-router/dev/dist/vite.js:2477:16)
at Object.handler (/Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/@react-router/dev/dist/vite.js:2029:13)
at async Promise.all (index 0)
at PluginDriver.hookParallel (file:///Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/rollup/dist/es/shared/node-entry.js:20740:9)
at file:///Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/rollup/dist/es/shared/node-entry.js:21783:13
at catchUnfinishedHookActions (file:///Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/rollup/dist/es/shared/node-entry.js:21158:16)
at Module.build (file:///Users/gustavo/repos/estudos/js/rr-cloudflare/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:65449:16) {
code: 'PLUGIN_ERROR',
plugin: 'react-router',
hook: 'writeBundle'
}
I'm using React Router as a...
framework
Reproduction
I'd like to prerender some routes like terms, privacy, about-us. But when I setup react-router.config.ts I got an error on building.
I just
npx create-react-router@latest
and changereact-router.config.ts
like this:It is happen on StackBlitz too
The error with default template
The error with cloudflare template
System Info
Used Package Manager
npm
Expected Behavior
I should prerender any route I want.
Actual Behavior
There isn't possible to prerender in any template.
The text was updated successfully, but these errors were encountered: