Skip to content

Router path duplication with --base in Slidev v52 #2629

Description

@mrsimpson

Bug Description

When using --base /path/ with Slidev v52.16.0, navigating to the next slide causes the URL to incorrectly duplicate the base path: /path/path/2 instead of /path/2.

Minimal Reproduction

git clone https://gist.github.com/mrsimpson/d44bb8c60d9540450f99d88a166eab17.git
cd slidev-bug-repro
npm install
npm run build -- --base /test-slides/
npx vite preview --base /test-slides/

Open http://localhost:4173/test-slides/1 and click 'next slide'.

Expected: http://localhost:4173/test-slides/2
Actual: http://localhost:4173/test-slides/test-slides/2

Environment

  • Slidev version: 52.16.0
  • Node.js: 20/24
  • OS: macOS/Windows/Linux

Notes

  • This bug only occurs with npm run build + vite preview, not with npm run dev
  • Works correctly in Slidev 0.50.x
  • Affects GitLab Pages deployments with subdirectory paths

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions