Conversation
The manual injection examples still imported @vitejs/devtools/client/inject*, which vitejs#529 removed. Point them at /__devtools/embedded.js, which the dev server now serves, and update the client-context page to match. Closes vitejs#589
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
The manual injection docs still tell users to import
@vitejs/devtools/client/inject(and the-passive/-hiddenvariants). #529 removed those exports, so following the guide fails at module resolution.The client is now served by the dev server at
/__devtools/embedded.js. This PR points both pages at it:/__devtools/embedded.js, built from the dev server's origin. The three per-visibility imports are gone. The client readsembeddedVisibilityfrom the server, so one entry covers all three modes.embedded.js, no virtual module), the iframe note (the[VITE DEVTOOLS] Skipping in iframelog no longer exists), and the troubleshooting fix and symptom.The URL uses
new URL(import.meta.url).originbecause a root-relative/__devtools/embedded.jsresolves against the page origin. On a backend-rendered page that origin is the backend, not Vite.new URL('/__devtools/…', import.meta.url)doesn't work either, because Vite rewrites it to/@fs/__devtools/embedded.js(404).Linked Issues
Closes #589
Additional context
I checked the snippet with the published Vite 8.3.1 and this branch's build. The HTML came from a separate plain HTTP server on another port, and
main.jswas loaded from the Vite dev server (devtools: { enabled: true }). In headless Chrome,<devframes-dock-embedded>mounted and the hub client context was published. This happened with both the defaultclientAuthandclientAuth: false. The old import still fails with"./client/inject" is not exported.pnpm exec eslinton the two files andpnpm -C docs run docs:buildpass.