Skip to content

fix(onboard): load DevTools v3, v4 and nightly releases - #1122

Merged
antfu merged 1 commit into
mainfrom
fix/onboard-load-any-devtools
Oct 13, 2026
Merged

antfu merged 1 commit into
mainfrom
fix/onboard-load-any-devtools

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

@nuxt/devtools-onboard (which Nuxt 5 nightly now depends on and pushes into _modules) could only hand off to @nuxt/devtools v4:

  • Its optional peer @nuxt/devtools@^4.0.0-beta.4 makes npm fail with ERESOLVE when the project has @nuxt/devtools v3 (for example a Nuxt 4 app that lists the onboard, or a Nuxt 5 app that kept v3), or a nightly whose version is a prerelease of a newer major.minor.patch (for example 4.0.1-<date>.<sha>).
  • A nightly installed under its real name, @nuxt/devtools-nightly, was never looked up, so the install button showed instead.
 setup()
   devtools disabled, or listed in modules -> return
-  resolve @nuxt/devtools                  -> installModule
+  resolve @nuxt/devtools-nightly          -> installModule
+  resolve @nuxt/devtools (v3, v4, alias)  -> installModule
   not dev                                 -> return
   inject install button (installs @nuxt/devtools@^<own version>)
  • The peer range is now *. npm only accepts a prerelease from another major.minor.patch when the range is * (dep-valid.js short-circuits it), so an explicit ^3.0.0 || ^4.0.0-0 would still reject future nightlies. The install button derives its spec from the onboard's own version, so it still installs the matching v4.
  • @nuxt/devtools-nightly wins when both names are installed: it is only there by deliberate opt-in, while @nuxt/devtools can arrive with another dependency.
  • The nightly build is unchanged: bump-nightly.ts still rewrites the peer to npm:@nuxt/devtools-nightly@<version>, which the install spec reads.

Evidence

npm install --package-lock-only with the onboard next to:

Installed DevTools Published onboard 4.0.0-beta.4 This branch (packed)
@nuxt/devtools@^3.2.0 (3.4.2) ERESOLVE, peerOptional @nuxt/devtools@"^4.0.0-beta.4" resolves
stand-in @nuxt/devtools@4.0.1-29860000.abcdef0 (nightly-style version) ERESOLVE resolves

Real @nuxt/devtools-nightly releases could not be used: the latest ones depend on -kit-nightly / -assets-nightly versions that are missing from the registry.

Unit test loads @nuxt/devtools-nightly installed under its own name, over @nuxt/devtools (stand-in packages in the fixture's node_modules):

  • Before: fails, expected '@nuxt/devtools' to be '@nuxt/devtools-nightly'
  • After: passes

Verification

  • pnpm test:unit: 21 files, 120 tests pass.
  • pnpm eslint packages/devtools-onboard: clean.
  • tsc --noEmit --skipLibCheck -p packages/devtools-onboard: no errors in src/ or test/. pnpm typecheck reports one error in packages/devtools/client/pages/modules/custom-[name].vue, which this PR does not touch.
  • pnpm install: lockfile unchanged.
  • Not verified: a full nuxt dev boot of Nuxt 5 with DevTools v3 through the onboard. The onboard only resolves and installs the module; whether v3 itself runs on Nuxt 5 is outside this change.

Merge Danger

Door: two-way. Restoring the peer range and the single lookup reverts it.

Blast Radius: install resolution. Package managers no longer warn or fail for any @nuxt/devtools version next to the onboard, including majors that cannot run on the installed Nuxt. Projects with both @nuxt/devtools and @nuxt/devtools-nightly installed now load the nightly.


Created with the help of an agent.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2303f81
Status: ✅  Deploy successful!
Preview URL: https://d506dbb4.nuxt-devtools.pages.dev
Branch Preview URL: https://fix-onboard-load-any-devtool.nuxt-devtools.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61452155-cadd-45b5-b057-b0a5a8e55750
📥 Commits

Reviewing files that changed from the base of the PR and between 10f9ee8 and 2303f81.

📒 Files selected for processing (4)
  • packages/devtools-onboard/README.md
  • packages/devtools-onboard/package.json
  • packages/devtools-onboard/src/module.ts
  • packages/devtools-onboard/test/module.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The onboarding module now checks for @nuxt/devtools-nightly before @nuxt/devtools and installs the first package that resolves. The peer dependency accepts any version. The README describes supported DevTools versions and package forms. A test verifies that nightly loads when both packages are installed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2303f

No actionable merge-blocking issue was established; the nightly alias remains resolvable by the onboard.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Description check Passed The description clearly explains the peer dependency and DevTools lookup changes, test evidence, verification results, and known limitations.
Title check Passed The title clearly and concisely identifies the fix for loading DevTools v3, v4, and nightly releases, which matches the main changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antfu
antfu merged commit d0b77e8 into main Oct 13, 2026
10 checks passed
@antfu
antfu deleted the fix/onboard-load-any-devtools branch October 13, 2026 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants