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
{{ message }}
Repository navigation
Allow SSR during development when ssr: false#15647
react-router dev will refuse to start when you have a loader but no prerender paths when ssr: false.
Prerender: 1 invalid route export in `routes/sitemap-index[.]xml` when pre-rendering with `ssr:false`: `loader`. See https://reactrouter.com/how-to/pre-rendering#invalid-exports for more information.
This is fine and preferable when building production. But it is hard to use when doing development.
I’d imagine a normal development workflow for a new path is:
add routes/new-path.tsx
add loader
add export default function Component
Make loader / Component work
add paths to prerender
Adding path to prerender is usually the last step after loader and Component is completed.
But React Router will refuse to start as soon as a loader is added.
This makes developers have to add prerender or dummy route before 2, which is not only counterintuitive but also hard sometimes when the new route is a dynamic route with params since you have to write logic to collect these from some datasource.
In addition:
When you rename the path, you have to fix prerender.
If you want to preview a new path with params, such as /posts/post-i-just-wrote, you have to add to prerender first.
If you use async function to collect paths, it doesn’t rerun automatically.
I feel the developer experience will be much better if ssr is allowed during development.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
react-router devwill refuse to start when you have a loader but no prerender paths whenssr: false.This is fine and preferable when building production. But it is hard to use when doing development.
I’d imagine a normal development workflow for a new path is:
routes/new-path.tsxloaderexport default function ComponentprerenderAdding path to prerender is usually the last step after loader and Component is completed.
But React Router will refuse to start as soon as a loader is added.
This makes developers have to add prerender or dummy route before 2, which is not only counterintuitive but also hard sometimes when the new route is a dynamic route with params since you have to write logic to collect these from some datasource.
In addition:
/posts/post-i-just-wrote, you have to add to prerender first.I feel the developer experience will be much better if ssr is allowed during development.
All reactions