DevTools silently disabled when `test: true` is set - seems not documented and possibly environment-dependent
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- nuxt, typescript
调研方向
通过切换 devtools.enabled 和 test 来复现 nuxt.config.ts 中的行为,然后阅读 nuxt.com/docs/getting-started/testing 中的测试文档。跟踪 test 模式如何影响所报告环境中的 DevTools 启用状态。确认预期行为,并将其清晰记录或完成修正,同时相关检查通过,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
When test: true is set in nuxt.config.ts, the Nuxt DevTools are silently disabled - even if devtools.enabled: true is explicitly configured.
This behavior seems environment-dependent. I've personally tested the following setups:
- ✅ Ubuntu native → DevTools show up even with
test: true(Ubuntu 24.04.1 LTS) - ❌ Debian native → DevTools do not show up when
test: true(Debian 12.11) - ❌ WSL2 (Ubuntu on Windows 10) → DevTools do not show up when
test: true(WSL2 Ubuntu 24.04.1 LTS on Windows 10 version 22H2)
I haven't tested on macOS or CI environments.
Also, I am not sure if this is not operating system dependent, but more node or pnpm version dependent as I had the same node, pnpm and project setup unified tested:
test setup
- node v22.14.0
- pnpm v10.9.0
- setup clean project only with:
pnpm create nuxt@latestwith pnpm, no modules and not git.
Only modification innuxt.config.ts, see below.
Test Result
- The following
nuxt.config.tsconfiguration:
Results in:devtools: { enabled: true }, test: true> pnpm dev > nuxt dev Nuxt 3.17.5 with Nitro 2.11.12 ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose ✔ Vite client built in 43ms ✔ Vite server built in 308ms ✔ Nuxt Nitro server built in 702ms ℹ Vite client warmed up in 2ms ℹ Vite server warmed up in 492ms - The following
nuxt.config.tsconfiguration:
Results in:devtools: { enabled: true }, test: false> pnpm dev > nuxt dev Nuxt 3.17.5 with Nitro 2.11.12 ➜ Local: http://localhost:3000/ ➜ Network: use --host to expose ➜ DevTools: press Shift + Alt + D in the browser (v2.5.0) ✔ Vite client built in 45ms ✔ Vite server built in 326ms ✔ Nuxt Nitro server built in 879ms ℹ Vite client warmed up in 2ms ℹ Vite server warmed up in 515ms
Expectation
If this is intentional behavior, it should be clearly documented.
If it's unintended, it might be worth addressing.
Currently, the documentation at https://nuxt.com/docs/getting-started/testing does not mention that enabling test mode disables DevTools.
Suggestion
Either:
- Clarify in the docs that
test: truedisables DevTools (and why), - Or treat it as a bug and allow DevTools to remain active in
testmode unless explicitly disabled.
Final Note
I'm not sure whether this is intended or accidental. Just raising this here so it's visible to the Nuxt team and the community.
I don't want to rule out the possibility that I may have missed something in the documentation. If that's the case, I apologize for the time taken and kindly ask you to close this issue.
Happy to help test further if needed.
- 主要语言
- TypeScript
- 星标
- 3.3k
- 派生
- 217
- 平均合并
- 20 小时 18 分钟
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nuxt/devtools 的其他 Issue
-
fix: Inspect panel styles break when host page sets a custom html font-size (rem-based units)可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 65/100
维护者通常 1 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 65/100
nuxt/devtools#1100 · 2 个 reaction ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
🐛 Bug: Calendar work items cannot be opened on mobile可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
jaegertracing/jaeger-ui#4596 ·
维护者通常 1 天内回复
-
area:tui enhancement platform:macos
难度 2/5 1-3 小时 新手友好度 66/100
anthropics/claude-code#101490 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
netlify/netlify-mcp#75 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复