Skip to content

fix(types): add vite as optional peer dependency#2712

Merged
posva merged 2 commits into
vuejs:mainfrom
ForgottenR:fix/missing-peer-dependency
May 19, 2026
Merged

fix(types): add vite as optional peer dependency#2712
posva merged 2 commits into
vuejs:mainfrom
ForgottenR:fix/missing-peer-dependency

Conversation

@ForgottenR

@ForgottenR ForgottenR commented May 13, 2026

Copy link
Copy Markdown

In strict package managers like pnpm with hoist=false, the vite package is not resolvable from vue-router's package directory, causing type errors such as "Cannot find module 'vite'". Adding vite as an optional peerDependency ensures the types are correctly resolved in monorepos.

Closes #2711

Summary by CodeRabbit

  • Chores
    • Declared Vite 7 and 8 as optional peer dependencies for the router package, allowing compatibility with those Vite versions.

Review Change Stack

In strict package managers like pnpm with hoist=false, the vite package
is not resolvable from vue-router's package directory, causing type errors
such as "Cannot find module 'vite'". Adding vite as an optional
peerDependency ensures the types are correctly resolved in monorepos.

Closes vuejs#2711
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for vue-router canceled.

Name Link
🔨 Latest commit 4e82394
🔍 Latest deploy log https://app.netlify.com/projects/vue-router/deploys/6a042f742efc3200076ad024

@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 860c4856-b899-45c3-b57c-686a0dc200f6

📥 Commits

Reviewing files that changed from the base of the PR and between d2cd6db and 4e82394.

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

📝 Walkthrough

Walkthrough

packages/router/package.json now lists vite as an optional peer dependency with version range ^7.0.0 || ^8.0.0 via peerDependencies and peerDependenciesMeta.

Changes

Vite Peer Dependency

Layer / File(s) Summary
Vite peer dependency and optional metadata
packages/router/package.json
Adds vite to peerDependencies with range `^7.0.0

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A tiny change hopped through the night,
Adding Vite as optional, tidy and light,
Two lines to bless the monorepo's sight,
Types find their home and everything's right,
A joyful twitch of a rabbit's delight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding vite as an optional peer dependency to resolve type resolution issues in monorepos.
Linked Issues check ✅ Passed The PR successfully addresses all requirements from issue #2711: declaring vite as an optional peer dependency to ensure proper type resolution in strict pnpm environments and monorepos.
Out of Scope Changes check ✅ Passed All changes are in-scope; only peer dependency and metadata declarations in package.json were modified to address the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Comment thread packages/router/package.json Outdated
@posva posva added 🐞 bug this isn't working as expected and removed 🐞 bug this isn't working as expected labels May 13, 2026
Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
@pkg-pr-new

pkg-pr-new Bot commented May 13, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vue-router@2712

commit: 4e82394

@codecov

codecov Bot commented May 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.14%. Comparing base (b840cd6) to head (4e82394).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2712      +/-   ##
==========================================
- Coverage   86.17%   86.14%   -0.04%     
==========================================
  Files          91       91              
  Lines       10202    10239      +37     
  Branches     2371     2379       +8     
==========================================
+ Hits         8792     8820      +28     
- Misses       1399     1408       +9     
  Partials       11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@posva posva merged commit facbf6b into vuejs:main May 19, 2026
10 checks passed
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.

Missing vite as optional peer dependency

2 participants