docs: manual client injection examples reference removed exports
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 74/100
- Issue 类型
- 文档
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
阅读没有 HTML 入口的项目的 Getting Started 部分和 Client Script & Client Context 页面,然后查看迁移到 @devframes/hub-ui 的提交 352456fb。更新这两个页面,使其使用当前的 /__devtools/embedded.js 入口,记录其托管和连接要求,并同步可见性模式示例;完成的标准是 აღარ再引用旧的 injection exports。
由索引模型根据 Issue 内容生成。
描述
Describe the bug
The manual client injection documentation still tells users to import @vitejs/devtools/client/inject, although that entry was removed when Vite DevTools adopted the @devframes/hub-ui client.
Affected pages:
This matters for backend-served HTML, middleware integrations, and JavaScript-only entries where automatic HTML injection does not run. Following the documented import fails during module resolution, before the client can initialize.
The @ts-expect-error comment in the guide addresses missing type declarations; it cannot suppress this module-resolution failure.
Reproduction
Using the published package, without building DevTools from source:
mkdir devtools-manual-injection-repro
cd devtools-manual-injection-repro
pnpm init
pnpm add -D -E [email protected] @vitejs/[email protected]
node --input-type=module -e "console.log(import.meta.resolve('@vitejs/devtools/client/inject'))"
Actual result:
ERR_PACKAGE_PATH_NOT_EXPORTED
Package subpath './client/inject' is not defined by "exports"
This is also reproducible through Vite with DevTools explicitly enabled. Create check.mjs:
import { createServer } from 'vite'
import { DevTools } from '@vitejs/devtools'
import { writeFile } from 'node:fs/promises'
await writeFile('old.js', "import '@vitejs/devtools/client/inject'\n")
const server = await createServer({
configFile: false,
plugins: await DevTools({ builtinDevTools: false }),
server: { host: '127.0.0.1', port: 5173, strictPort: true },
devtools: { open: false },
})
try {
await server.listen()
await server.transformRequest('/old.js')
}
finally {
await server.close()
}
Run node check.mjs. The Vite transformation fails with:
"./client/inject" is not exported under the conditions
["module", "browser", "development", "import"]
The published package also does not export ./client/inject-passive or ./client/inject-hidden, both of which are still shown in the guide.
Migration evidence
Commit 352456fb in #529 removed the old client directory and the three injection exports, added @devframes/hub-ui, and changed injection to load the hub-served /__devtools/embedded.js script.
The capability still exists. I verified a backend-served HTML page that loads this script through a same-origin HTTP/WebSocket proxy to Vite: after authorization, the dock appeared and the Settings panel opened. This verifies that setup, not arbitrary cross-origin configurations.
Expected behavior
Please update the manual integration instructions to describe the current supported entry and its hosting/connection requirements, and synchronize the client-context explanation and visibility-mode examples.
The request is to retain and update the manual integration guidance. It does not require restoring the removed npm exports or deleting support for backend-served pages.
Environment
vite: 8.3.0@vitejs/devtools: 0.7.5- Package manager: pnpm
- Reproduced on macOS using published packages.
- 主要语言
- TypeScript
- 星标
- 1.2k
- 派生
- 91
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vitejs/devtools 的其他 Issue
-
Rolldown "Run build with devtools" produces a development build (inherits the dev server's NODE_ENV)未关闭
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
feat(oxc): add rule timing stats to the lint inspector可能已有人在做 @yuyinws 于 11 天前认领。 未关闭enhancement
vitejs/devtools#584 · 已指派 1 人 ·
维护者通常 1 天内回复
-
pending triage
难度 3/5 1-2 天 新手友好度 58/100
维护者通常 1 天内回复
-
pending triage
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
相似的 Issue
-
Mend: dependency security vulnerability untriaged
难度 2/5 1-3 小时 新手友好度 68/100
opensearch-project/security-dashboards-plugin#2545 ·
维护者通常 1 天内回复
-
Add: Dream TR SD未关闭check:passed streams:add
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
SocialGouv/egapro#4672 · 1 条评论 ·
维护者通常 2 天内回复
-
area:agents area:tui bug
难度 2/5 1-3 小时 新手友好度 74/100
anthropics/claude-code#98358 ·
维护者通常 1 天内回复