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
- A pnpm project with
virtualStoreType: global and vite-plus@1.0.0, playwright@1.63.0 and @vitest/browser-playwright@5.0.1 as devDependencies.
- In
vite.config.ts: provider: playwright({ contextOptions: { reducedMotion: "bogus" } }) from vite-plus/test/browser-playwright.
vp check passes.
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.
What happens
vite-plus/dist/test/browser-playwright.d.tsimports types fromplaywright:vite-plusdoesn't declareplaywrightas a dependency or a peer. It only declares@vitest/browser-playwrightas an optional peer. With pnpm's isolated layouts (confirmed withvirtualStoreType: global), vite-plus's own slot therefore has noplaywright, and TypeScript can't resolve the import. WithskipLibCheck: true(the usual setting), the Playwright types in the provider's declarations silently lose their meaning:playwright({ contextOptions })is unchecked, socontextOptions: { reducedMotion: "bogus" }compiles;cdp().send(...), typed through theCDPSessionaugmentation, is error-typed, so type-aware Oxlint reportsno-unsafe-callon every call.Repro
virtualStoreType: globalandvite-plus@1.0.0,playwright@1.63.0and@vitest/browser-playwright@5.0.1as devDependencies.vite.config.ts:provider: playwright({ contextOptions: { reducedMotion: "bogus" } })fromvite-plus/test/browser-playwright.vp checkpasses.lsvite-plus's slot (<store>/links/@/vite-plus/1.0.0/<hash>/node_modules/):vitest,vite,oxlint… but noplaywright.Proposal
Declare
playwrightas an optional peer ofvite-plus, the way@vitest/browser-playwrightalready is:Workaround: a
.pnpmfile.mjsreadPackagehook that adds that optional peer tovite-plus. With it,playwrightis linked into vite-plus's slot, andvp checkrejectsreducedMotion: "bogus"withTS2322: 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.