{"id":22892,"library":"vite-plugin-tsc-watch","title":"vite-plugin-tsc-watch","description":"Plugs tsc --watch into Vite dev server, enabling TypeScript type-checking during development without blocking the build pipeline. Current stable version is 3.1.2 (Feb 2025), with releases roughly every 6 months tracking Vite and TypeScript peer updates. Key differentiators: dev-only, low-noise (no overlay), uses Vite's dev server for logging, lightweight compared to alternatives like fork-ts-checker-webpack-plugin. Supports TS solution config and ESM-only since v3.","status":"active","version":"3.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/ArnaudBarre/vite-plugin-tsc-watch","tags":["javascript","vite","vite-plugin","tsc","typescript"],"install":[{"cmd":"npm install vite-plugin-tsc-watch","lang":"bash","label":"npm"},{"cmd":"yarn add vite-plugin-tsc-watch","lang":"bash","label":"yarn"},{"cmd":"pnpm add vite-plugin-tsc-watch","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for running tsc","package":"typescript","optional":false},{"reason":"Peer dependency for Vite plugin API","package":"vite","optional":false}],"imports":[{"note":"Named export only since v3.0.0; default export was removed in v2.0.0, renamed in v3.0.1.","wrong":"import tscWatch from 'vite-plugin-tsc-watch'","symbol":"tscWatch","correct":"import { tscWatch } from 'vite-plugin-tsc-watch'"},{"note":"Plugin is ESM-only since v3.0.1; require() triggers a warning. Use ESM import or migrate Vite to ESM.","wrong":"const { tscWatch } = require('vite-plugin-tsc-watch')","symbol":"vite-plugin-tsc-watch","correct":"import { tscWatch } from 'vite-plugin-tsc-watch'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport { tscWatch } from 'vite-plugin-tsc-watch';\n\nexport default defineConfig({\n  plugins: [tscWatch()],\n});","lang":"typescript","description":"Import the named export `tscWatch` and add it to the Vite plugins array."},"warnings":[{"fix":"Use `import { tscWatch } from 'vite-plugin-tsc-watch'` instead of default import.","message":"Default export removed in v2.0.0, replaced with named export `tscPlugin`. In v3.0.1, renamed to `tscWatch`.","severity":"breaking","affected_versions":">=2.0.0 <3.0.1"},{"fix":"Switch to ESM imports or migrate Vite to ESM (see Vite migration guide).","message":"ESM-only since v3.0.1; CommonJS require() is deprecated but still works with a warning.","severity":"breaking","affected_versions":">=3.0.1"},{"fix":"Upgrade to Vite 4+ and Node 18+.","message":"Dropped support for Vite 2 & 3 and Node <18 in v3.0.1.","severity":"breaking","affected_versions":">=3.0.1"},{"fix":"Rename `tscPlugin` to `tscWatch` in your imports.","message":"The named export `tscPlugin` (v2.0.0 to v3.0.0) is deprecated; use `tscWatch` instead.","severity":"deprecated","affected_versions":">=2.0.0 <3.0.1"},{"fix":"Add `\"noEmit\": true` to `compilerOptions` in your tsconfig.json.","message":"The plugin does not emit compiled JS files; you must set `noEmit: true` in tsconfig to avoid file pollution.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Replace `import tscWatch from ...` with `import { tscWatch } from 'vite-plugin-tsc-watch'`.","cause":"Using default import after v3.0.1 when plugin switched to ESM and named export.","error":"Error: The plugin 'vite-plugin-tsc-watch' requires a named export 'tscWatch'"},{"fix":"Switch to ESM import or use dynamic import: `const { tscWatch } = await import('vite-plugin-tsc-watch')`.","cause":"Using `const tscWatch = require('vite-plugin-tsc-watch')` in CJS context after v3.0.1 (ESM-only).","error":"TypeError: vitePluginTscWatch is not a function"},{"fix":"Run `npm install -D typescript vite` to install peer dependencies.","cause":"Missing or incompatible peer dependencies (typescript or vite).","error":"Error: Cannot find module 'vite-plugin-tsc-watch' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}