fix(core): declare client module resolution before plugin setup - #582
Merged
antfu merged 1 commit intoSep 25, 2026
Merged
Conversation
antfu
approved these changes
Sep 25, 2026
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
morinokami
added a commit
to morinokami/astro-devtools
that referenced
this pull request
Sep 27, 2026
The Astro docks name their renderer by the bare specifier
"astro-devtools/client", which the dev server loads through Vite's
`/@id/` resolution. Up to 0.7.5, Vite DevTools declared that
resolution only in `initHub()`, after every plugin's
`devtools.setup()` had run, so each dock registration warned DF8111
("the script will fail to load") about a script that loads fine.
`setup()` worked around it by writing the template into
`staticConfig.dock` itself.
Vite DevTools 0.7.6 declares the template in `createDevToolsContext`,
before any plugin setup runs (vitejs/devtools#582):
- Bump the six `@vitejs/devtools-*` entries of the `devtools` catalog
to 0.7.6. The devframe family stays at 1.0.0, which upstream's own
v0.7.6 lockfile also resolves; devframe 1.1.0 is left for a bump of
its own.
- Drop the workaround from `setup()`.
- Raise the `@vitejs/devtools` and `@vitejs/devtools-kit` peer ranges
to ^0.7.6. Without the workaround, 0.7.5 prints DF8111 once per
custom-render dock.
- Rename the e2e test that looks for DF8111 in the server log: the
integration no longer declares the resolution, but the test still
guards the peer floor.
Claude-Session: https://claude.ai/code/session_01DLDVYeDh6abCj8w9TxSXUQ
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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
A plugin that registers a dock with a bare-specifier client script inside
devtools.setup()(e.g.action: { importFrom: 'my-plugin/devtools-action' }, as the Kit docs show) gets a falseDF8111warning ("the script will fail to load") on the dev server, although the script loads fine through/@id/.The hub checks
staticConfig.dock.clientModuleResolutioninsidedocks.register(), but core only declared it viainitHub()increateDevToolsHub, which runs aftercreateDevToolsContexthas already run every plugin'ssetup().This declares the template in
createDevToolsContext, before any dock registers. It stays dev-server only, so build / standalone keep warning as before.initHubstill receives the same value, which covers contexts assembled elsewhere.Linked Issues
Mentioned in passing in devframes/devframe#289 ("fires even in plain Vite, where the dock works fine"), which was closed without addressing it.
Additional context
vite-plugin-vue-tracer(viteDevtools: true): published 0.7.5 prints 1 warning, this branch prints 0. The advertisedclientModuleResolutionand the/@id/…response (200) are identical in both.