-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Which project does this relate to?
Start
Describe the bug
(creating issue from discord discussion here https://discord.com/channels/719702312431386674/1421224773895192627/1421224773895192627)
When setting vite's base option in vite.config.ts:
export default defineConfig({
base: '/custombasepath',
...
})I get the following error:
[prerender] Prerendering pages...
[prerender] Concurrency: 8
[prerender] Crawling: /
[prerender] Prerendered 1 pages:
[prerender] - /
[sitemap] Hint: Pages found, but no sitemap host has been set. To enable sitemap generation, set the `sitemap.host` option.
file:///Users/andriymassimilla/Projects/a2-ai/portkey/frontend/node_modules/@tanstack/start-plugin-core/dist/esm/prerender.js:109
throw new Error(`Failed to fetch ${page.path}: ${res.statusText}`, {
^
Error: Failed to fetch /:
at file:///Users/andriymassimilla/Projects/a2-ai/portkey/frontend/node_modules/@tanstack/start-plugin-core/dist/esm/prerender.js:109:19
at async file:///Users/andriymassimilla/Projects/a2-ai/portkey/frontend/node_modules/@tanstack/start-plugin-core/dist/esm/queue.js:38:17 {
[cause]: Response {}
}
Node.js v24.9.0
note that createRouter includes the rewriteBasepath rewrite function (the other basepath parameter is marked as deprecated):
const router = createRouter({
routeTree,
scrollRestoration: true,
rewrite: rewriteBasepath({
basepath: "/custombasepath",
}),
});Your Example Website or App
https://stackblitz.com/edit/vitejs-vite-jvynrgn2?file=package.json
Steps to Reproduce the Bug or Issue
pnpm ipnpm run build
Expected behavior
As a user, I expected the build to complete without error even when specifying a custom base path, but instead an error is thrown.
Screenshots or Videos
No response
Platform
- Router / Start Version: 1.132.7/1.132.10
- OS: macOS
- Browser: Arc (chromium)
- Browser Version:
Version 1.114.0 (69006)
Chromium Engine Version 140.0.7339.208 - Bundler: vite
- Bundler Version: 7.1.7
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels