Skip to content

fix(core): fix devtools asset routing under /__devtools#353

Merged
webfansplz merged 1 commit into
vitejs:mainfrom
JianJroh:fix/h3-mount-trailing-slash
May 20, 2026
Merged

fix(core): fix devtools asset routing under /__devtools#353
webfansplz merged 1 commit into
vitejs:mainfrom
JianJroh:fix/h3-mount-trailing-slash

Conversation

@JianJroh
Copy link
Copy Markdown
Contributor

Summary

After running vite-devtools (e.g. pnpm -F @vitejs/devtools play:build), opening /__devtools/ loads the SPA shell but every asset under /__devtools/assets/* returns 404.

Cause

PR #346 (h3 v1 → v2 migration) changed the sub-app mount from app.use(DEVTOOLS_MOUNT_PATH, h3.handler) to app.use(DEVTOOLS_MOUNT_PATH, h3). With an H3 instance, app.use routes through H3.mount(base, subApp), whose
internal matcher assumes base has no trailing slash:

Additional context

https://github.com/h3js/h3/blob/84244b49b84e6ce6260d6b3a3590409e0d525fab/src/h3.ts#L129-L140

@JianJroh JianJroh force-pushed the fix/h3-mount-trailing-slash branch from c628ecb to b69850b Compare May 19, 2026 08:48
@JianJroh JianJroh force-pushed the fix/h3-mount-trailing-slash branch from b69850b to 711d857 Compare May 19, 2026 08:48
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@353
npm i https://pkg.pr.new/@vitejs/devtools-kit@353
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@353
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@353

commit: 711d857

@webfansplz
Copy link
Copy Markdown
Member

Seems be related to #354

@webfansplz webfansplz changed the title fix(core): drop trailing slash from h3 subapp mount base fix(core): fix devtools asset routing under /__devtools May 20, 2026
@webfansplz webfansplz merged commit ee667f4 into vitejs:main May 20, 2026
7 checks passed
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.

2 participants