When the Base URL Is Not '/' #1242
Closed
mitchell-up
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
did you try out https://tanstack.com/router/v1/docs/framework/react/api/router/RouterOptionsType#basepath ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
We often encouner situations where it's necessary to change our project's base URL. This adjustment can be made by configuring the base URL in
vite.config.js
.However, after setting the base URL, we're encountering a 404 error when accessing the pages. This issue arises because the index route path '/' has been changed to '/your-base-url', but there aren't any correct matchings in
routeTree.gen.ts
.Of course, one way to solve this problem is by adding a directory named 'your-base-url' and moving the routes files into that folder.
Idea
What if we consider setting the base configuration option in
TanStackRouterVite
? By specifying the base URL inTanStackRouterVite
, it would automatically adapt '/' to '/your-base-url'.I'm open to discussing this idea further or exploring other potential solutions you might have in mind.
Beta Was this translation helpful? Give feedback.
All reactions