Skip to content

fix: patch @slidev/client to avoid base path doubling#354

Merged
ogadra merged 2 commits into
mainfrom
fix/slidev-base-path-doubling
Jun 22, 2026
Merged

fix: patch @slidev/client to avoid base path doubling#354
ogadra merged 2 commits into
mainfrom
fix/slidev-base-path-doubling

Conversation

@ogadra

@ogadra ogadra commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

This PR ships a local pnpm patch that reverts getSlidePath to a base-relative path so vue-router prepends BASE_URL exactly once. Removable once the upstream fix is released.

Test plan

  • pnpm install succeeds and applies the patch from patches/@slidev__client@52.16.0.patch
  • pnpm --filter <any-slide> build succeeds
  • pnpm run dev (wrangler) — navigate from slide 1 to slide 2 on any /<slide>/1 page; URL stays at /<slide>/2 (no doubling)
  • Reload at /<slide>/2 works (no 404)
  • Deep link https://slide.ogadra.com/<slide>/5 loads slide 5 directly

Summary by CodeRabbit

リリースノート

  • Bug Fixes
    • スライド表示時のURL パス処理における問題を修正しました。複数環境でのベースURLの重複適用による不具合を解決し、正常なナビゲーションを実現しています。

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>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 22567fa1-3790-4736-b3b0-ab4e0c63a230

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

@slidev/client@52.16.0getSlidePathimport.meta.env.BASE_URL を二重に付与するバグを回避するため、パッチファイルを新規作成し、package.jsonpnpm.patchedDependencies でそのパッチを適用するよう設定した。

Changes

Slidev クライアントパッチ適用

Layer / File(s) Summary
getSlidePath 修正パッチと pnpm 設定
patches/@slidev__client@52.16.0.patch, package.json
getSlidePath の戻り値を import.meta.env.BASE_URL を含まないベース相対パス(/export/<no>/presenter/<no>/<no>)に変更するパッチファイルを追加し、package.jsonpnpm.patchedDependencies でそのパッチを @slidev/client@52.16.0 に適用するよう設定する。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 ぴょんとジャンプ、BASE_URL 二重はもうおさらば
パッチひとつで道は一本、
/base/base/N なんてもう迷わない
pnpm がぴたりとあてがって、
スライドの道は正しくまっすぐ ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed プルリクエストのタイトルは、主な変更内容(@slidev/clientのベースパス重複問題を修正するためのパッチ適用)を明確かつ簡潔に説明しており、変更セット全体を正確に反映しています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/slidev-base-path-doubling

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
slide 115bc9c Jun 22 2026, 03:48 AM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3aeac7c and 1c35b13.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • patches/@slidev__client@52.16.0.patch

Comment thread package.json
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>
@ogadra
ogadra merged commit 214a1cd into main Jun 22, 2026
2 checks passed
@ogadra
ogadra deleted the fix/slidev-base-path-doubling branch June 22, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant