Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prerendering with node-custom-server fail #65

Open
mxp-qk opened this issue Jan 21, 2025 · 0 comments
Open

Prerendering with node-custom-server fail #65

mxp-qk opened this issue Jan 21, 2025 · 0 comments

Comments

@mxp-qk
Copy link

mxp-qk commented Jan 21, 2025

I'm trying to migrate a remix app to react-router v7 with a custom server. It works fine until we tried adding some prerendered page to the react-router config.

To reproduce :

  • start from the node template npx create-react-router@latest --template remix-run/react-router-templates/node-custom-server
  • add a prerender option to react-router config prerender:["/"]
  • run npm run build

Here the error

[react-router] Cannot convert undefined or null to object
    at Function.values (<anonymous>)
    at groupRoutesByParentId2 (.../node_modules/@react-router/dev/dist/vite.js:2717:10)
    at createPrerenderRoutes (.../node_modules/@react-router/dev/dist/vite.js:2728:76)
    at handlePrerender (.../node_modules/@react-router/dev/dist/vite.js:2544:16)
    at Object.handler (.../node_modules/@react-router/dev/dist/vite.js:2066:13)
    at async Promise.all (index 0)
    at PluginDriver.hookParallel (file://.../node_modules/rollup/dist/es/shared/node-entry.js:20868:9)
    at file://.../node_modules/rollup/dist/es/shared/node-entry.js:21911:13
    at catchUnfinishedHookActions (file://.../node_modules/rollup/dist/es/shared/node-entry.js:21286:16)
    at Module.build (file://.../node_modules/vite/dist/node/chunks/dep-Cjmyj91f.js:65599:16) {
  code: 'PLUGIN_ERROR',
  plugin: 'react-router',
  hook: 'writeBundle'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant