Environment:
- Slidev version: 52.16.0 (introduced in v52.16.0, worked correctly in v52.15.2)
- Browser: All
Describe the bug:
When building Slidev slides with --base /talks/<folder>/ and using $slidev.nav.next or $slidev.nav.go(), the router navigation results in duplicated base path in the URL.
Actual behavior:
- Initial URL:
/talks/2026-06-30-xihuan/
- Click nav.next →
/talks/2026-06-30-xihuan/talks/2026-06-30-xihuan/2 (WRONG - base duplicated)
- Expected:
/talks/2026-06-30-xihuan/2 (CORRECT)
Root cause:
In v52.16.0, getSlidePath (packages/client/logic/slides.ts) was changed to include import.meta.env.BASE_URL:
// v52.15.2 and earlier:
return exporting ? `/export/${no}` : presenter ? `/presenter/${no}` : `/${no}`
// v52.16.0+:
return exporting ? `/export/${no}` : presenter ? `/presenter/${no}` : `${import.meta.env.BASE_URL}${no}`
Then in useNav.ts, the go() method does:
await router.push({
path: getSlidePath(...), // already includes BASE_URL
...
})
But createWebHistory(BASE_URL) in setup/main.ts treats the path as relative and prepends the base again, causing duplication.
Reproduction:
pnpm exec slidev build --base /talks/2026-06-30-xihuan/ --out dist
# Serve with any static file server
# Navigate via $slidev.nav.next → URL will have duplicated base
Workarounds:
- Downgrade to v52.15.2 (last known working version)
- Use keyboard shortcuts (Space/Arrow) instead of
$slidev.nav.next
Expected fix:
getSlidePath should return path segments without the base prefix, letting createWebHistory handle the base path automatically (like it does for createMemoryHistory and other router implementations).
Environment:
Describe the bug:
When building Slidev slides with
--base /talks/<folder>/and using$slidev.nav.nextor$slidev.nav.go(), the router navigation results in duplicated base path in the URL.Actual behavior:
/talks/2026-06-30-xihuan//talks/2026-06-30-xihuan/talks/2026-06-30-xihuan/2(WRONG - base duplicated)/talks/2026-06-30-xihuan/2(CORRECT)Root cause:
In v52.16.0,
getSlidePath(packages/client/logic/slides.ts) was changed to includeimport.meta.env.BASE_URL:Then in
useNav.ts, thego()method does:But
createWebHistory(BASE_URL)insetup/main.tstreats thepathas relative and prepends the base again, causing duplication.Reproduction:
Workarounds:
$slidev.nav.nextExpected fix:
getSlidePathshould return path segments without the base prefix, lettingcreateWebHistoryhandle the base path automatically (like it does forcreateMemoryHistoryand other router implementations).