Which project does this relate to?#
Router
Describe the bug#
it cannot easily be reproduced in stackblitz, however, I forked and create a repo in the examples:
https://github.com/TanStack/router/commit/5d32b97b0b6a4ab8cb3b0a7d4f98376722be371f
to reproduce:
- Run
basic-ssr-streaming-file-based
- Go to
http://localhost:3000/my-app/posts/2
- Notice it is being redirected to
http://localhost:3000/error
This only happens when the beforeLoad happens on the server, if you set the SSR to false on the component that throws the redirect, the issue doesn't happen.
Expected: it should redirect to http://localhost:3000/my-app/error
I will try to create a PR, not sure I will have the capacity this week,
Thanks for the quick response!!
Your Example Website or App#
https://github.com/TanStack/router/commit/5d32b97b0b6a4ab8cb3b0a7d4f98376722be371f
Steps to Reproduce the Bug or Issue#
- Run
basic-ssr-streaming-file-based
- Go to
http://localhost:3000/my-app/posts/2
- Notice it is being redirected to
http://localhost:3000/error
Expected behavior#
Expected: it should redirect to http://localhost:3000/my-app/error
Screenshots or Videos#
No response
Platform#
- Router / Start Version: [e.g. 1.121.0]
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Browser Version: [e.g. 91.1]
- Bundler: [e.g. vite]
- Bundler Version: [e.g. 7.0.0]
Additional context#
No response
the example seems to run, but it just because the server (express) is using a wildcard to catch all routes and not only the basepath