Skip to content

fix: mark unhead peer dependency as optional#824

Open
stuible wants to merge 1 commit into
nuxt:mainfrom
stuible:fix-optional-unhead-peer
Open

fix: mark unhead peer dependency as optional#824
stuible wants to merge 1 commit into
nuxt:mainfrom
stuible:fix-optional-unhead-peer

Conversation

@stuible

@stuible stuible commented Jul 6, 2026

Copy link
Copy Markdown

Summary

  • mark @unhead/vue as an optional peer dependency
  • avoid npm auto-installing Unhead 3 when Nuxt already provides a compatible Unhead 2 version

Why

@nuxt/scripts supports both Unhead v2 and v3, but npm currently auto-installs @unhead/vue@3.x for Nuxt 4.4.8 apps that do not directly declare the peer. That can create mixed Unhead v2/v3 installs and Nitro node-server output can package an incomplete unhead runtime, causing SSR imports like unhead/server to fail at runtime.

Making the peer optional keeps the existing compatibility range, while allowing the consuming Nuxt app's existing Unhead version to be reused.

Verification

  • confirmed npm reuses Nuxt's @unhead/vue@2.1.15 with this metadata change
  • built a minimal Nuxt app using @nuxt/scripts and imported the generated renderer successfully
  • ran package build, lint, type tests, unit/runtime tests, and full build

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@stuible is attempting to deploy a commit to the Nuxt Team on Vercel.

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@824

commit: e75bcbb

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f6eeb38c-cb83-4696-aabc-3a3bc09d6c35

📥 Commits

Reviewing files that changed from the base of the PR and between 40c2b23 and e75bcbb.

📒 Files selected for processing (1)
  • packages/script/package.json

📝 Walkthrough

Walkthrough

This change updates packages/script/package.json to add an entry for "@unhead/vue" under peerDependenciesMeta, marking it as optional. No other configuration or code changes are included.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Changes

File Summary
packages/script/package.json Added peerDependenciesMeta entry marking "@unhead/vue" as an optional peer dependency.

Related issues: None specified.

Related PRs: None specified.

Suggested labels: dependencies, package.json

Suggested reviewers: None specified.

Poem
A tiny hop, a rabbit's cheer,
One peer dependency made clear,
"Optional" now, no need to fret,
@unhead/vue, no worries yet,
A small edit, but tidy and neat! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: making the Unhead peer dependency optional.
Description check ✅ Passed The description clearly matches the change and explains the motivation, behavior, and verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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.

1 participant