Repository navigation
fix(node): serve devtools under base path - #662
Open
huang-julien wants to merge 1 commit into
Open
huang-julien wants to merge 1 commit into
huang-julien wants to merge 1 commit into
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vite-task
@vitejs/devtools-vitest
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Hey 👋
This PR makes the dev-mode embedded loader respect Vite's
baseand makes the hub answer underbasetoo.Why
When working on the Storybook integration, I noticed that the Storybook preview was mounting the host app's dock instead of its own which ends up in an infinite reload.
Storybook's Vite plugin starts a second Vite server in
middlewareModewithbase: '/storybook/', and the parent server strips/storybookbefore handing requests over. That inner server has its own hub at/storybook/__devtools/, but its pages still load/__devtools/embedded.js, which is the outer hub (or a 404 if there's none). If the host registers an iframe dock pointing at Storybook, it nests itself endlessly.The issue lies in
DevToolsInjection: it only addsconfig.basewhenconfig.command === 'build', so in serve mode the loader always points at the root.Reporudction
Screen.Recording.2026-12-02.at.13.21.37.mov
open the devtools dock of storybook. it will be linked to the actual devtool of the app rather thean the nested storybook.
Fix screenshot
You can see that the devtools in storybook isn't the one from the app as it doesn't dock Storybook within Storybook
Linked Issues
Additional context