Not able to configure base path.
I'm trying to serve a TanStack Start app off a base path ie.
/tan
. Here's what I've tried.
- Setting only basepath: "/tan"
in the createTanStackRouter()
=> all css
and js
are served off root "/"
, not "/tan"
(screenshot 1)
- Setting both basepath: "/tan"
in the createTanStackRouter()
, and also vite.base: "/tan"
in app.config.ts
=> css
is served off "/tan"
, js
are served off root "/"
(screenshot 2)
^ context, I'm deploying the Start app to AWS CloudFront, where root /
points to a static landing page, and /blog
points to the Start app.

7 Replies
sensitive-blueOP•6mo ago
The tests was done by running
vinxi start
locallyabsent-sapphire•6mo ago
is this the same issue as https://discord.com/channels/719702312431386674/1339584143549403186/1347216553091010572 ?
sensitive-blueOP•6mo ago
ah yup.. seems to be the same issue
absent-sapphire•6mo ago
I think we don't have a GitHub issue for this yet. can you please create one including a complete minimal example repo?
sensitive-blueOP•6mo ago
will do
adverse-sapphire•6mo ago
@Frank did you create one? I am still stuck around this issue to find a good config mix that work, if there even is one.
adverse-sapphire•6mo ago
FYI i created one here: https://github.com/TanStack/router/issues/3925
Creating a PR for this seems really complicated. I am not even sure if this is a problem with TSR or nitro right now.
GitHub
Serving TSS on basepath (e.g. /hub) does not correctly serve assets...
Which project does this relate to? Start Describe the bug A defined basepath is not respected correctly in TSS. A basepath in TSS can be set in theory by: setting basepath: '/hub' in create...