Skip to content

Commit 148fa0a

Browse files
committed
docs: add the v4 upgrade guide for apps and rework the module migration guide
The migration page was a list of deprecation codes with no explanation of the new model and nothing for app developers. Split it in two: - guide/upgrading-to-v4: requirements (Nuxt 4.5+ / Vite 8), how Nuxt 4 users opt in, the authorization prompt, what moved where, option changes, and troubleshooting. - module/migration-v4: the Vite DevTools model, whether to migrate now, an at-a-glance table, then a step-by-step walk (deps, docks, scoped RPC, iframe client, terminals, messages) that keeps every NDT_DEP anchor the diagnostics link to. Fixes the enablePages(token) example and the Vite peer range, and drops the outdated claim that categories and launch views are not covered. The module authors guide now teaches the v4 API first, and the module-starter playground is migrated to it so the docs have a worked, browser-verified example. README, getting started and the features page no longer describe v4 as alpha or mention the removed popup/split view.
1 parent 6932dca commit 148fa0a

18 files changed

Lines changed: 546 additions & 674 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ Unleash Nuxt Developer Experience.
2424
</p>
2525

2626
> [!NOTE]
27-
> You are current at the `main` branch for v4 development. The latest stable branch is [`v3`](https://github.com/nuxt/devtools/tree/v3).
27+
> You are at the `main` branch for v4. The v3 branch is [`v3`](https://github.com/nuxt/devtools/tree/v3).
2828
2929
<br>
3030

3131
## Installation
3232

33-
> Nuxt DevTools v2 requires **Nuxt v3.15.0 or higher**.
33+
> Nuxt DevTools v4 requires **Nuxt v4.5.0 or higher** (Vite 8). It is built on [Vite DevTools](https://github.com/vitejs/devtools) and shows up as the `Nuxt` group inside the Vite DevTools panel.
3434
35-
Nuxt DevTools is **enabled by default** in Nuxt v3.8.0. You can press <kbd>Shift</kbd> + <kbd>Alt</kbd> / <kbd>⇧ Shift</kbd> + <kbd>⌥ Option</kbd> + <kbd>D</kbd> in your app to open it up.
35+
Nuxt DevTools is **enabled by default**. You can press <kbd>Shift</kbd> + <kbd>Alt</kbd> / <kbd>⇧ Shift</kbd> + <kbd>⌥ Option</kbd> + <kbd>D</kbd> in your app to open it up.
3636

3737
If you want to explicitly enable or disable Nuxt DevTools, you can update your `nuxt.config` with:
3838

@@ -44,52 +44,9 @@ export default defineNuxtConfig({
4444
})
4545
```
4646

47-
### Opting in to v4.0
47+
### Nuxt 4
4848

49-
Nuxt DevTools v4.0 is currently in alpha. Since Nuxt ships with a built-in version of DevTools, you can opt-in to v4.0 by using package manager resolutions to override the bundled version:
50-
51-
<details>
52-
<summary>npm</summary>
53-
54-
```json
55-
{
56-
"overrides": {
57-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
58-
}
59-
}
60-
```
61-
62-
</details>
63-
64-
<details>
65-
<summary>yarn</summary>
66-
67-
```json
68-
{
69-
"resolutions": {
70-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
71-
}
72-
}
73-
```
74-
75-
</details>
76-
77-
<details>
78-
<summary>pnpm</summary>
79-
80-
```json
81-
{
82-
"pnpm": {
83-
"overrides": {
84-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
85-
}
86-
}
87-
}
88-
```
89-
90-
</details>
91-
92-
Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies.
49+
Nuxt 5 ships with Nuxt DevTools v4. Nuxt 4.5+ still bundles v3; override `@nuxt/devtools` to `^4.0.0` with your package manager (`overrides` for npm and pnpm, `resolutions` for yarn), remove your lockfile and reinstall. See the [upgrade guide](https://devtools.nuxt.com/guide/upgrading-to-v4) for details and for what changed.
9350

9451
### Nightly Release Channel
9552

‎docs/content/1.guide/0.getting-started.md‎

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,11 @@ export default defineNuxtConfig({
1515

1616
### Open the DevTools Panel
1717

18-
Restart your Nuxt server and open your app in browser. Click the Nuxt icon on the bottom (or press :kbd{value="Shift"} + :kbd{value="Alt"} / :kbd{value="⇧ Shift"} + :kbd{value="⌥ Option"} + :kbd{value="D"}) to toggle the DevTools.
18+
Restart your Nuxt server and open your app in browser. Click the Vite DevTools trigger at the bottom of the page (or press :kbd{value="Shift"} + :kbd{value="Alt"} / :kbd{value="⇧ Shift"} + :kbd{value="⌥ Option"} + :kbd{value="D"}) to toggle the DevTools. The first time, Vite DevTools asks you to authorize the browser with the code printed in your terminal.
1919

20-
### Opting in to v4.0
20+
### Nuxt 4
2121

22-
Nuxt DevTools v4.0 is currently in alpha and requires Vite 8 — it integrates
23-
with [Vite DevTools](https://github.com/vitejs/devtools), whose Code Server
24-
dock only peers with Vite 8. Since Nuxt ships with a built-in version of
25-
DevTools, you can opt-in to v4.0 by using package manager resolutions to
26-
override the bundled version:
27-
28-
::code-group
29-
30-
```json [npm]
31-
{
32-
"overrides": {
33-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
34-
}
35-
}
36-
```
37-
38-
```json [yarn]
39-
{
40-
"resolutions": {
41-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
42-
}
43-
}
44-
```
45-
46-
```json [pnpm]
47-
{
48-
"pnpm": {
49-
"overrides": {
50-
"@nuxt/devtools": "npm:@nuxt/devtools-nightly@latest"
51-
}
52-
}
53-
}
54-
```
55-
56-
::
57-
58-
Remove lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and reinstall dependencies.
22+
Nuxt 5 ships with Nuxt DevTools v4. Nuxt 4.5+ still bundles v3; override it to `^4.0.0` with your package manager as described in [Upgrading to v4](/guide/upgrading-to-v4#nuxt-45). Nuxt 4.0–4.4 ship Vite 7 and cannot run v4.
5923

6024
### Nightly Release Channel
6125

‎docs/content/1.guide/1.features.md‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,3 @@ Inspect expose the [`vite-plugin-inspect`](https://github.com/antfu/vite-plugin-
168168
## Settings
169169

170170
Settings tab allows you to configure the DevTools to your needs. you can hide tabs, change tabs order, scale, theme and more...
171-
172-
## Nuxt Icon
173-
174-
Nuxt Icon is the first item on sidebar, located at the top left corner of the DevTools. It gives you a quick access to some useful features such as `Toggle Theme`, `Settings`, `Split Screen`, `Popup`, `Refresh Data`, `Refresh Page`. you can simply click on it and see the them yourself.
175-
176-
### Command Palette
177-
178-
Command Palette is a quick way to access some useful features of the DevTools such as easy navigation, run commands and Nuxt Documentations. You can open it with `Ctrl+K` or `Cmd+K` shortcut.
179-
180-
### Split Screen
181-
182-
Split Screen is a useful feature to use multiple tabs at the same time. You can open it from `Command Palette` or by clicking the `Nuxt Icon` in the top left corner of the DevTools and activate it from there.
183-
184-
### Popup
185-
186-
Popup is very useful for those who has a second screen, you can open it by clicking the `Nuxt Icon` in the top left corner of the DevTools and activate it from there.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
title: Upgrading to v4
3+
description: 'What changes for your app when you move from Nuxt DevTools v3 to v4.'
4+
---
5+
6+
Nuxt DevTools v4 is built on [Vite DevTools](https://github.com/vitejs/devtools). Instead of shipping its own floating panel, it registers a `Nuxt` group inside the Vite DevTools panel, next to Vue DevTools, Vite Inspect, Terminals, Messages and the other tools your Vite plugins provide. Everything you know from the Nuxt side (Pages, Components, Imports, Modules, Server Routes, Timeline, …) lives in that group.
7+
8+
This page is for app developers. If you maintain a Nuxt module that integrates with DevTools, read the [module migration guide](/module/migration-v4) as well.
9+
10+
## Requirements
11+
12+
- **Vite 8.1.5 or later.** Vite DevTools only works with Vite 8.
13+
- That means **Nuxt 4.5 or later**, or **Nuxt 5**. Nuxt 4.0–4.4 ship Vite 7 and cannot run DevTools v4.
14+
15+
If you are on an older Nuxt 4, upgrade Nuxt first. Overriding `vite` on Nuxt 4.4 to Vite 8 is not supported.
16+
17+
## Installing
18+
19+
### Nuxt 5
20+
21+
Nuxt 5 ships with DevTools v4. There is nothing to install:
22+
23+
```ts [nuxt.config.ts]
24+
export default defineNuxtConfig({
25+
devtools: { enabled: true },
26+
})
27+
```
28+
29+
### Nuxt 4.5+
30+
31+
Nuxt 4 still bundles DevTools v3. Override the bundled version with your package manager, then reinstall:
32+
33+
::code-group
34+
35+
```json [npm]
36+
{
37+
"overrides": {
38+
"@nuxt/devtools": "^4.0.0"
39+
}
40+
}
41+
```
42+
43+
```json [yarn]
44+
{
45+
"resolutions": {
46+
"@nuxt/devtools": "^4.0.0"
47+
}
48+
}
49+
```
50+
51+
```json [pnpm]
52+
{
53+
"pnpm": {
54+
"overrides": {
55+
"@nuxt/devtools": "^4.0.0"
56+
}
57+
}
58+
}
59+
```
60+
61+
::
62+
63+
Remove your lockfile (`package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`) and run the install again so the override takes effect.
64+
65+
## Opening DevTools
66+
67+
The floating Nuxt button at the bottom of the page is gone; the Vite DevTools trigger takes its place. The keyboard shortcut is unchanged: :kbd{value="Shift"} + :kbd{value="Alt"} / :kbd{value="⇧ Shift"} + :kbd{value="⌥ Option"} + :kbd{value="D"} toggles the Nuxt entry.
68+
69+
Vite DevTools can run shell commands and read files on your machine, so it asks you to **authorize the browser once per project**. On first open you will see an _Unauthorized_ badge; enter the 6-digit code printed in your terminal (or click the link printed next to it). In sandboxed environments such as StackBlitz and CodeSandbox the prompt is skipped automatically. To skip it elsewhere, set `devtools.disableAuthorization: true` in `nuxt.config.ts` — only do this on a machine you trust.
70+
71+
To turn Vite DevTools off entirely (Nuxt DevTools included), disable it in your Vite config on Vite 8.3+:
72+
73+
```ts [nuxt.config.ts]
74+
export default defineNuxtConfig({
75+
vite: {
76+
devtools: false,
77+
},
78+
})
79+
```
80+
81+
## What moved
82+
83+
| v3 | v4 |
84+
| ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
85+
| Floating Nuxt panel | `Nuxt` group in the Vite DevTools panel |
86+
| Nuxt Options Viewer | **Data Inspector** → `Nuxt Application` source, with a live [jora](https://discoveryjs.github.io/jora/) query workbench |
87+
| Terminals tab | Vite DevTools **Terminals** dock (shared with every tool) |
88+
| Built-in VS Code integration (`devtools.vscode`) | **Code Server** dock (`devtools.codeServer`), see below |
89+
| Vue DevTools tab | Vue DevTools dock, next to the `Nuxt` group (`vite-plugin-vue-devtools` v9) |
90+
| Popup (Picture-in-Picture) and Split Screen | Removed; Vite DevTools owns the panel layout |
91+
| `nuxi devtools enable/disable` | Removed; set `devtools.enabled` in `nuxt.config.ts` |
92+
93+
Module tabs contributed by Nuxt modules you install (for example `@nuxt/fonts`, `@nuxt/scripts`, `nuxt-og-image`) keep working. They appear in the `Nuxt` group under the _Modules_ category.
94+
95+
## Configuration changes
96+
97+
### `vscode` is replaced by `codeServer` {#code-server}
98+
99+
The VS Code integration is now the Code Server plugin. It supports a locally installed Coder [`code-server`](https://coder.com/docs/code-server/install), detected when DevTools starts and launched on demand.
100+
101+
```diff [nuxt.config.ts]
102+
export default defineNuxtConfig({
103+
devtools: {
104+
- vscode: { enabled: true },
105+
+ codeServer: { enabled: true },
106+
},
107+
})
108+
```
109+
110+
The old `vscode` value is ignored and a `NDT_DEP_0008` warning is printed. The following v3 modes no longer exist:
111+
112+
- Microsoft `code serve-web` and `code-server serve-local`
113+
- VS Code tunnels
114+
- reusing an already running server, or starting one on boot
115+
- the `vscode-server-controller` extension
116+
117+
The generic _open in editor_ action (from component and file links) is unaffected. `codeServer` accepts `enabled`, `bin`, `cwd`, `serverPort`, `host`, `args`, `env`, `cookieSuffix` and `startTimeout`.
118+
119+
### Removed options
120+
121+
- `viteDevTools` — Vite DevTools is always on; use `vite.devtools: false` to turn it off.
122+
- `ui.showPanel` and `ui.minimizePanelInactive` — the floating panel no longer exists.
123+
- `devtoolsGlobal` — DevTools cannot be installed globally any more.
124+
- `experimental.timeline` — still honored, but use `timeline.enabled` instead.
125+
126+
### New options
127+
128+
- `vueDevTools` (default `true`) — set to `false` to skip the Vue DevTools dock.
129+
- `dataInspector` (default `true`) — set to `false` to skip the Data Inspector source.
130+
- `disableAuthorization` (default: on in sandboxes) — skips the authorization prompt described above.
131+
132+
## Deprecation warnings in your terminal
133+
134+
Lines such as `[NDT_DEP_0003] extendServerRpc is deprecated` come from a Nuxt module you installed, not from your app. The module keeps working; the warning tells its author which v4 API to move to. Each code links to the relevant section of the [module migration guide](/module/migration-v4), which is the right place to point the maintainer to.
135+
136+
## Troubleshooting
137+
138+
- **The dev server crashes at startup mentioning `@vitejs/devtools-rolldown`.** You are on Vite 7 (Nuxt ≤ 4.4). Upgrade to Nuxt 4.5 or later.
139+
- **Opening `/__nuxt_devtools__/client/` directly shows empty data.** The client needs the connection the Vite DevTools panel gives it; open DevTools from the app page instead.
140+
- **The authorization code does not appear.** It is printed by the dev server process; look in the terminal running `nuxt dev`, not in the browser console.

0 commit comments

Comments
 (0)