diff --git a/docs/errors/VDT0001.md b/docs/errors/VDT0001.md new file mode 100644 index 00000000..2066fab8 --- /dev/null +++ b/docs/errors/VDT0001.md @@ -0,0 +1,25 @@ +--- +outline: deep +--- + +# VDT0001: Inspect Context Unavailable + +## Message + +> Vite inspect context is not available for this DevTools context. + +## Cause + +A `vite:inspect:*` RPC function was called in a DevTools context that did not register the Vite inspect collector. + +## Example + +Calling `vite:inspect:get-modules-list` while only the base Vite metadata RPC functions are registered triggers this error. + +## Fix + +Register the Vite UI plugin with inspect collection enabled before calling `vite:inspect:*` RPC functions. + +## Source + +- [`packages/vite/src/node/inspect/context.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite/src/node/inspect/context.ts) — `getViteInspectContext()` throws this when no inspect context was registered for the current DevTools context. diff --git a/docs/errors/VDT0002.md b/docs/errors/VDT0002.md new file mode 100644 index 00000000..ce16c0c7 --- /dev/null +++ b/docs/errors/VDT0002.md @@ -0,0 +1,25 @@ +--- +outline: deep +--- + +# VDT0002: Inspect Target Not Found + +## Message + +> Vite inspect target "`{id}`" was not found in `{target}`. + +## Cause + +An inspect RPC query referenced a Vite instance or environment that the collector has not recorded. + +## Example + +Calling `vite:inspect:get-module-transform-info` with an unknown `{ vite, env }` query triggers this error. + +## Fix + +Read `vite:inspect:get-metadata` first and pass one of the returned Vite instance IDs and environment names to follow-up inspect RPC calls. + +## Source + +- [`packages/vite/src/node/inspect/context.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite/src/node/inspect/context.ts) — `getViteContext()` and `getEnvContext()` throw this when a query references an unknown inspect target. diff --git a/docs/errors/index.md b/docs/errors/index.md index 10004303..05772d60 100644 --- a/docs/errors/index.md +++ b/docs/errors/index.md @@ -9,7 +9,7 @@ Vite DevTools uses structured diagnostics to surface actionable warnings and err ## How error codes work - Codes follow the pattern **prefix + 4-digit number** (e.g., `DF0001`, `DTK0008`, `RDDT0002`). -- Each prefix maps to a package: `DTK` for `@vitejs/devtools` (Vite-specific pieces), `RDDT` for `@vitejs/devtools-rolldown`. The framework-neutral `devframe` package documents its own `DF`-prefixed codes at the [Devframe docs site](https://devfra.me/errors/). +- Each prefix maps to a package: `DTK` for `@vitejs/devtools` (Vite-specific pieces), `RDDT` for `@vitejs/devtools-rolldown`, `VDT` for `@vitejs/devtools-vite`. The framework-neutral `devframe` package documents its own `DF`-prefixed codes at the [Devframe docs site](https://devfra.me/errors/). - Every error page includes the cause, recommended fix, and a reference to the source file that emits it. - The diagnostics system is powered by [`nostics`](https://github.com/vercel-labs/nostics), which provides structured diagnostic codes with docs URLs and ANSI-formatted console output. @@ -42,3 +42,12 @@ Emitted by `@vitejs/devtools-rolldown`. |------|-------|-------| | [RDDT0001](./RDDT0001) | warn | Rolldown Logs Directory Not Found | | [RDDT0002](./RDDT0002) | warn | Rolldown Log Reader Bad Line | + +## Vite DevTools (VDT) + +Emitted by `@vitejs/devtools-vite`. + +| Code | Level | Title | +|------|-------|-------| +| [VDT0001](./VDT0001) | error | Inspect Context Unavailable | +| [VDT0002](./VDT0002) | error | Inspect Target Not Found | diff --git a/docs/kit/diagnostics.md b/docs/kit/diagnostics.md index cadb527e..5d1d6657 100644 --- a/docs/kit/diagnostics.md +++ b/docs/kit/diagnostics.md @@ -75,7 +75,7 @@ Prefixes used by the in-tree packages: | `DF` | `devframe` | | `DTK` | `@vitejs/devtools` | | `RDDT` | `@vitejs/devtools-rolldown` | -| `VDT` | `@vitejs/devtools-vite` (reserved) | +| `VDT` | `@vitejs/devtools-vite` | Each definition supports `why` (string or function returning a string) and an optional `fix` (string or function). A `docsBase` on the definition group auto-attaches a per-code URL to every emitted diagnostic. diff --git a/packages/rolldown/src/app/components/assets/Sunburst.vue b/packages/rolldown/src/app/components/assets/Sunburst.vue index 1792a71f..6f61b53e 100644 --- a/packages/rolldown/src/app/components/assets/Sunburst.vue +++ b/packages/rolldown/src/app/components/assets/Sunburst.vue @@ -1,6 +1,7 @@ @@ -101,7 +107,9 @@ function unselectToggle() { @change="toggleRule(rule)" >
-
{{ rule.description || rule.name }}
+
+ {{ rule.description || rule.name }} +