Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Geschlossen Anfängerfreundlich
#2,854 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@liangmiQwQ arbeitet bereits daran.

Seit 02.10.2026.

  • #2865 von @liangmiQwQ — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
84/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
playwright, typescript

Rechercherichtung

Beginne mit vite-plus/dist/test/browser-playwright.d.ts und den Paketmetadaten, die seine Peer-Abhängigkeiten steuern. Füge playwright als optionale Peer-Abhängigkeit hinzu und führe dann die bereitgestellte pnpm-Reproduktion und vp check aus, um zu bestätigen, dass ungültige contextOptions zurückgewiesen werden und die Deklarationstypen korrekt aufgelöst werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
6.5k
Forks
296
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
224

Entwicklungsumgebung

In Codespaces öffnen

Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus voidzero-dev/vite-plus

Alle Issues in voidzero-dev/vite-plus

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.