Vite and TypeScript won't catch non-Baseline APIs — here's how to fix that
Vite 7 defaults to Baseline Widely Available as its production build target, but a successful build does not guarantee that every API used is broadly supported across browsers. TypeScript similarly checks APIs against declaration files like lib.dom.d.ts, which are not filtered by Baseline availability status. This creates a gap where APIs such as Promise.withResolvers() and Document.startViewTransition() — both still in 'Newly Available' status at time of testing — can pass both Vite builds and TypeScript checks without any warning. Developers can address this by installing the typescript-baseline-lib and @baseline-types/dom-widely-available packages and configuring a separate tsconfig.baseline.json that replaces standard libraries with Baseline-scoped declarations. Running this as a dedicated CI check using tsc produces errors for any non-Baseline APIs without requiring changes to the main build pipeline.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in