fix: patch @slidev/client to avoid base path doubling#354
Conversation
Slidev 52.16.0 (slidevjs/slidev@a0c3857) made `getSlidePath` prepend `import.meta.env.BASE_URL` to every slide path. vue-router's history is already created with that same `BASE_URL` as its base, so navigation ends up applying the prefix twice and the URL becomes `/<base>/<base>/N` (reported upstream as slidevjs/slidev#2629; fixed by PR #2630, not yet released). Apply a local pnpm patch that reverts `getSlidePath` to return a base-relative path until the upstream fix lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthrough
ChangesSlidev クライアントパッチ適用
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
slide | 115bc9c | Jun 22 2026, 03:48 AM |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Around line 38-41: There is a version mismatch in the pnpm configuration where
the `@slidev/client` dependency definition specifies `^52.14.2` but
`pnpm-lock.yaml` has resolved to version `52.15.2`, while the
`patchedDependencies` entry is configured for `@slidev/client@52.16.0`. This
mismatch prevents the patch from being applied. Resolve this by either updating
the dependency version constraint to `^52.16.0` to match the patchedDependencies
target, or updating the patchedDependencies entry to target the resolved version
`@slidev/client@52.15.2`, or removing the patch configuration entirely if it is
no longer needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: f0d8f302-22cb-4ff4-b4ea-2f01eca8b094
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
package.jsonpatches/@slidev__client@52.16.0.patch
CodeRabbit flagged that `pnpm.patchedDependencies` targets `@slidev/client@52.16.0` while the workspace constraint `^52.14.2` was resolving to 52.15.2. The patch still worked because the actually executed code is `@slidev/cli@52.16.0`'s nested copy of `@slidev/client@52.16.0`, but the manifest was misleading. Bump the constraint to `^52.16.0` so the top-level resolution matches the patched version. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
getSlidePathprependimport.meta.env.BASE_URLto every slide pathBASE_URLas its base, so navigation ends up applying the prefix twicehttps://slide.ogadra.com/<slide>/1navigates tohttps://slide.ogadra.com/<slide>/<slide>/2which 404s on reload / breaks OGPThis PR ships a local
pnpm patchthat revertsgetSlidePathto a base-relative path so vue-router prependsBASE_URLexactly once. Removable once the upstream fix is released.Test plan
pnpm installsucceeds and applies the patch frompatches/@slidev__client@52.16.0.patchpnpm --filter <any-slide> buildsucceedspnpm run dev(wrangler) — navigate from slide 1 to slide 2 on any/<slide>/1page; URL stays at/<slide>/2(no doubling)/<slide>/2works (no 404)https://slide.ogadra.com/<slide>/5loads slide 5 directlySummary by CodeRabbit
リリースノート