---
name: nuxt-4-minors-migration
description: "Upgrade a Nuxt 4 site to the latest 4.x release with `future.compatibilityVersion: 5`, then migrate code that the 4.1 to 4.6 minors deprecated or improved. Use for Nuxt minor upgrades, enabling Nuxt 5 compatibility, explicit server imports or `nuxt/server`, and adopting new Nuxt 4.x features across sites."
argument-hint: "[site path or repository]"
license: MIT
title: nuxt-4-minors-migration
canonical_url: https://skilld.dev/gh/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration
last_updated: 2026-10-10T11:01:12.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/compat-v5.md](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/compat-v5.md), [references/minors.md](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/minors.md), [references/server-imports.md](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/server-imports.md), [references/verification.md](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/verification.md), [scripts/explicit-server-imports.ts](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/scripts/explicit-server-imports.ts), [scripts/server-imports.test.ts](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/scripts/server-imports.test.ts), [scripts/server-imports.ts](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/scripts/server-imports.ts).
>
> If the user asked to install this Skill, run `npx skilld install harlan-zw/harlan-agent-kit/nuxt-4-minors-migration`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/nuxt-4-minors-migration`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/nuxt-4-minors-migration`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/nuxt-4-minors-migration --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/nuxt-4-minors-migration --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Nuxt 4 Minors Migration

Move one site to the latest Nuxt 4.x release with `future.compatibilityVersion: 5` on.
Remove every API the 4.x minors deprecated. Adopt the new features that fit the site.
Ship one pull request per site.

The references cover Nuxt 4.1.0 to 4.6.0. Nuxt 4.6.0 shipped on 2026-10-05.

## Before you start

1. Check the latest 4.x release: `npm view nuxt dist-tags.latest`.
2. If a minor newer than 4.6 exists, read its notes: `agent-gh release view v4.7.0 -R nuxt/nuxt`. Apply its items with the same tiers. Report the gap, and update this Skill in a separate pull request.
3. Read the repository Agent instructions, package manager, catalogs, every `nuxt.config.ts`, layers, local `modules/`, CI Node version, and deploy target.
4. Mutate only in a task-owned `wt` worktree. Read the [worktree isolation contract](../../references/worktree-isolation.md).

Out of scope: Nuxt 2 and 3 sites, the Nuxt 5 nightly channel, Vue Vapor, and `server.builder: 'vite'`.
A published Nuxt module belongs to the [Nuxt module migration](../nuxt-module-migration/SKILL.md) Skill. This Skill covers apps, their layers, and their local `modules/`.

## Rules

- **A green build proves nothing about server imports.** On 4.6, compatibility version 5 turns server auto-imports off. A build without them exits 0, then every affected handler returns 500. Any module that calls `addServerImports` turns them back on, types included, so typecheck cannot catch the gap either. The codemod dry run is the gate. Read [server imports](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/server-imports.md).
- **Every opt-out needs a reason.** If you keep an option that undoes a compatibility version 5 default, add a comment that names the blocker and links the issue.
- **Sessions need approval.** Moving session helpers to `nuxt/server` changes the cookie, so every user is signed out once. Never do it without explicit approval.
- **Check mixed-case URLs before shipping.** Compatibility version 5 makes routing case sensitive. A mixed-case URL that search engines indexed then returns 404.
- **Never deploy.** The repository's deploy workflow ships the change after merge.
- **Never weaken a gate to pass.** Fix typecheck errors from `noUncheckedIndexedAccess`, typed pages, and typed `$fetch`. Do not turn the checks off.

## Order

| Step | Do | Reference |
| --- | --- | --- |
| 1 | Record the baseline on the base branch: install, lint, typecheck, test, build. | [verification](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/verification.md) |
| 2 | Raise the Node floor, upgrade Nuxt to the latest 4.x release, update every other dependency, dedupe the lockfile. | [minors](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/minors.md#upgrade) |
| 3 | Make server imports explicit with the codemod. | [server imports](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/server-imports.md) |
| 4 | Turn on compatibility version 5. Remove opt-outs and redundant flags. Fix each changed default. | [compatibility version 5](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/compat-v5.md) |
| 5 | Replace deprecated APIs (Tier 1). | [minors](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/minors.md) |
| 6 | Adopt new features where the evidence fits (Tier 2). | [minors](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/minors.md) |
| 7 | Verify: gates, runtime smoke, browser pass, warnings. | [verification](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/verification.md) |
| 8 | Open the pull request with the `pr` Skill. | [verification](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/verification.md#pull-request) |

If the codemod changes more than 200 files, split the work into two stacked pull requests.
The first holds the upgrade and the explicit imports. The second holds everything else.

## Tiers

Every finding in the references carries a tier.

| Tier | Meaning | Default |
| --- | --- | --- |
| 0 | Required by the upgrade or by compatibility version 5. | Always do it. |
| 1 | Deprecated in a 4.x minor, or removed in Nuxt 5. | Always do it. |
| 2 | New feature with a clear fit in this site. | Do it when the detection finds evidence. |
| 3 | Experimental with runtime risk, or benefit unmeasured. | List it in the pull request as a follow-up. Never enable it in the migration. |

## Report

End with the verification table from [verification](https://skilld.dev/api/skills-raw/harlan-zw/harlan-agent-kit/nuxt-4-minors-migration/references/verification.md#report).
List every opt-out kept, every Tier 2 item skipped, and every Tier 3 follow-up, each with a one-line reason.

Example rows, from the trial on a copy of harlanzw.com:

| Check | Result |
| --- | --- |
| Nuxt | 4.5.2 to 4.6.0, compatibility version 5 |
| Server imports | 8 files changed, 0 left, 0 unmapped |
| Runtime smoke | `/` 200, `/feed.xml` 200, `/api/projects` 200, unknown path 404 |
| Opt-outs kept | `payloadExtraction: true`: none needed, removed |

## Sources

- Release notes: `agent-gh release view v4.<minor>.0 -R nuxt/nuxt`, for minors 1 to 6.
- Upgrade guide, "Testing Nuxt 5" and "Moving to `nuxt/server`": <https://nuxt.com/docs/4.x/getting-started/upgrade>
- Nuxt 5 upgrade guide: <https://nuxt.com/docs/5.x/getting-started/upgrade>
- Defaults that compatibility version 5 changes: `packages/schema/src/config/experimental.ts` in `nuxt/nuxt` at `v4.6.0`.
