Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`vite-plus/test/browser-playwright` types import `playwright`, which vite-plus does not declare, so provider options go unchecked under pnpm

Đã đóng Phù hợp với người mới
#2,854 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@liangmiQwQ đang làm issue này rồi.

Từ ngày 2/10/2026.

  • #2865 của @liangmiQwQ — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
playwright, typescript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Bắt đầu với vite-plus/dist/test/browser-playwright.d.ts và metadata của package kiểm soát các peer dependency của nó. Thêm playwright dưới dạng peer tùy chọn, sau đó chạy quy trình tái hiện được cung cấp bằng pnpm và vp check để xác nhận rằng các contextOptions không hợp lệ bị từ chối và các kiểu khai báo được phân giải chính xác.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

pending triage

What happens

vite-plus/dist/test/browser-playwright.d.ts imports types from playwright:

import { Page, Frame, FrameLocator, BrowserContext, CDPSession, Browser, LaunchOptions, ConnectOptions, BrowserContextOptions } from 'playwright';

vite-plus doesn't declare playwright as a dependency or a peer. It only declares @vitest/browser-playwright as an optional peer. With pnpm's isolated layouts (confirmed with virtualStoreType: global), vite-plus's own slot therefore has no playwright, and TypeScript can't resolve the import. With skipLibCheck: true (the usual setting), the Playwright types in the provider's declarations silently lose their meaning:

  • playwright({ contextOptions }) is unchecked, so contextOptions: { reducedMotion: "bogus" } compiles;
  • cdp().send(...), typed through the CDPSession augmentation, is error-typed, so type-aware Oxlint reports no-unsafe-call on every call.

Repro

  1. A pnpm project with virtualStoreType: global and [email protected], [email protected] and @vitest/[email protected] as devDependencies.
  2. In vite.config.ts: provider: playwright({ contextOptions: { reducedMotion: "bogus" } }) from vite-plus/test/browser-playwright.
  3. vp check passes.
  4. ls vite-plus's slot (<store>/links/@/vite-plus/1.0.0/<hash>/node_modules/): vitest, vite, oxlint… but no playwright.

Proposal

Declare playwright as an optional peer of vite-plus, the way @vitest/browser-playwright already is:

"peerDependencies": { "playwright": "*" },
"peerDependenciesMeta": { "playwright": { "optional": true } }

Workaround: a .pnpmfile.mjs readPackage hook that adds that optional peer to vite-plus. With it, playwright is linked into vite-plus's slot, and vp check rejects reducedMotion: "bogus" with TS2322: Type '"bogus"' is not assignable to type '"no-preference" | "reduce" | null | undefined'.

Versions: vite-plus 1.0.0, pnpm 12.8.1, playwright 1.63.0, TypeScript 7.0.2, macOS.

Ngôn ngữ chính
Rust
Star
6k
Fork
274
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
196

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của voidzero-dev/vite-plus

Tất cả issue của voidzero-dev/vite-plus

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.