Skip to content

fix(core): redirect devtools mount path to trailing slash#305

Merged
antfu merged 1 commit into
vitejs:mainfrom
onmax:fix-devtools-trailing-slash
May 7, 2026
Merged

fix(core): redirect devtools mount path to trailing slash#305
antfu merged 1 commit into
vitejs:mainfrom
onmax:fix-devtools-trailing-slash

Conversation

@onmax
Copy link
Copy Markdown
Contributor

@onmax onmax commented May 5, 2026

Opening the standalone DevTools URL without a trailing slash currently serves the DevTools HTML at /.devtools, but the HTML references assets with relative ./assets/... URLs. Browsers resolve those relative to the parent path and request /assets/... instead of /.devtools/assets/..., which causes JS/CSS MIME errors and a blank screen.

This redirects the exact DevTools mount path to the canonical directory URL while preserving query strings. Subpaths such as auth and assets continue to be handled by the existing middleware.

Probably there is better solutions, so I am open for another approach

@onmax onmax force-pushed the fix-devtools-trailing-slash branch from b50f16f to 8948b3d Compare May 5, 2026 09:27
@onmax onmax marked this pull request as ready for review May 5, 2026 09:31
@onmax onmax changed the title fix: redirect devtools mount path to trailing slash fix(core): redirect devtools mount path to trailing slash May 5, 2026
@onmax onmax force-pushed the fix-devtools-trailing-slash branch from 8948b3d to e1b8f0e Compare May 5, 2026 09:33
@antfu antfu merged commit 740f64e into vitejs:main May 7, 2026
5 checks passed
@onmax onmax deleted the fix-devtools-trailing-slash branch May 7, 2026 08:20
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