{"id":10910,"library":"fork-ts-checker-webpack-plugin","title":"Fork TS Checker Webpack Plugin","description":"The `fork-ts-checker-webpack-plugin` is a Webpack plugin designed to significantly improve build performance in TypeScript projects by offloading the TypeScript type checking process to a separate worker process. This allows `ts-loader` or `babel-loader` to operate in `transpileOnly` mode, focusing solely on transpilation without blocking the main Webpack compilation thread for type checks. The current stable version is 9.1.0, released on April 3, 2025. The project has a moderately active release cadence, issuing several patches and minor versions annually, with major versions arriving less frequently but introducing breaking changes like Node.js or TypeScript version bumps. Key differentiators include its support for modern TypeScript features such as project references and incremental builds, and its ability to display well-formatted error messages with code frames directly within the Webpack output. It's an essential tool for maintaining fast build times in large TypeScript-based Webpack applications.","status":"active","version":"9.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/TypeStrong/fork-ts-checker-webpack-plugin","tags":["javascript","webpack","plugin","typescript","typecheck","ts-loader","fork","fast"],"install":[{"cmd":"npm install fork-ts-checker-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add fork-ts-checker-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add fork-ts-checker-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for type checking.","package":"typescript","optional":false},{"reason":"Core dependency as a Webpack plugin.","package":"webpack","optional":false}],"imports":[{"note":"The plugin is a default export. While Webpack configurations often use CommonJS `require()`, modern JavaScript modules use the default import syntax.","wrong":"import { ForkTsCheckerWebpackPlugin } from 'fork-ts-checker-webpack-plugin';","symbol":"ForkTsCheckerWebpackPlugin","correct":"import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';"},{"note":"This is the most common way to import the plugin in `webpack.config.js` files, which are typically CommonJS modules.","symbol":"ForkTsCheckerWebpackPlugin (CommonJS)","correct":"const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');"},{"note":"Import the type definition for plugin options for type-safe configuration in TypeScript.","symbol":"ForkTsCheckerWebpackPlugin.Options","correct":"import type { ForkTsCheckerWebpackPluginOptions } from 'fork-ts-checker-webpack-plugin';"}],"quickstart":{"code":"const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');\n\nmodule.exports = {\n  context: __dirname,\n  entry: './src/index.ts',\n  resolve: {\n    extensions: [\".ts\", \".tsx\", \".js\"]\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.tsx?$/,\n        loader: 'ts-loader',\n        options: {\n          transpileOnly: true // Crucial for performance with this plugin\n        }\n      }\n    ]\n  },\n  plugins: [new ForkTsCheckerWebpackPlugin()],\n  watchOptions: {\n    ignored: /node_modules/ // Adjust for monorepos\n  }\n};","lang":"javascript","description":"This quickstart demonstrates how to integrate `fork-ts-checker-webpack-plugin` with `ts-loader` in a minimal Webpack configuration. It highlights the use of `transpileOnly: true` on `ts-loader` to offload type checking to the plugin's separate process, thereby speeding up build times."},"warnings":[{"fix":"Upgrade your Node.js environment to version 14.21.3 or higher. If unable to upgrade Node.js, downgrade the plugin to version 8.x.","message":"Version 9.0.0 of `fork-ts-checker-webpack-plugin` dropped support for Node.js v12. Users must upgrade to Node.js v14.21.3 or newer.","severity":"breaking","affected_versions":">=9.0.0"},{"fix":"For Vue.js support, downgrade to `fork-ts-checker-webpack-plugin@6` or implement a custom type checking solution for Vue SFCs.","message":"Version 8.0.0 removed built-in support for Vue.js SFCs (Single File Components). Projects relying on Vue.js type checking should use version 6.x of the plugin or integrate alternative solutions.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Add `options: { transpileOnly: true }` to your `ts-loader` rule in `webpack.config.js`.","message":"If using `ts-loader` versions older than 9.3.0, it is essential to set `transpileOnly: true` in its options. Failure to do so will cause `ts-loader` to perform type checking itself, negating the performance benefits of this plugin.","severity":"gotcha","affected_versions":"<9.3.0 (ts-loader)"},{"fix":"Adjust the `watchOptions.ignored` pattern to specifically include only external `node_modules` or remove it if using a monorepo setup with symlinked packages.","message":"The `watchOptions.ignored: /node_modules/` configuration in Webpack can cause issues in monorepos or projects with linked packages, as changes in `node_modules` of linked packages might not trigger recompilations.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure your `fork-ts-checker-webpack-plugin` version aligns with your Webpack and TypeScript versions. For Webpack 4, use plugin version 6.x. For TypeScript 2.1-2.6.2, use plugin version 4.x. For TypeScript 2.7-3.5.3, use plugin version 6.x.","message":"Older versions of Webpack (v4) or TypeScript (2.1-2.6.2 or 2.7-3.5.3) require specific older versions of `fork-ts-checker-webpack-plugin`. Consult the README for compatibility matrices.","severity":"breaking","affected_versions":"<8.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"This specific error was fixed in `v9.0.1`. Upgrade `fork-ts-checker-webpack-plugin` to version 9.0.1 or newer. If the problem persists, check your TypeScript configuration for any unusual setups or corrupted files.","cause":"The plugin's worker process crashed due to an unhandled internal error, often related to an unexpected TypeScript or system state.","error":"Error: Worker caught an error: Unhandled error in worker."},{"fix":"Upgrade `fork-ts-checker-webpack-plugin` to version 8.0.0 or newer. This version includes a fix for ignoring `node_modules` on Windows.","cause":"An issue in older versions of the plugin on Windows where `node_modules` directories were not correctly ignored by the type checker.","error":"Type checking occurs in node_modules on Windows, leading to unexpected errors or slow performance."},{"fix":"Upgrade `fork-ts-checker-webpack-plugin` to version 6.5.3 or newer. This version provides compatibility with TypeScript 5's performance API.","cause":"Compatibility issues with the plugin's performance API when used with TypeScript 5.","error":"Error: 'performance.now()' is not compatible with TypeScript 5."},{"fix":"Ensure `fork-ts-checker-webpack-plugin` is correctly instantiated in your Webpack plugins array. Verify `ts-loader` has `options: { transpileOnly: true }` enabled to delegate type checking to the plugin.","cause":"The plugin might not be correctly configured, or `ts-loader` is running in `transpileOnly: false` mode, causing it to block compilation on errors before the plugin can report them.","error":"No TypeScript errors are displayed in Webpack output, even though `tsc` reports errors."}],"ecosystem":"npm"}