{"id":14582,"library":"flow-status-webpack-plugin","title":"Flow Status Webpack Plugin","description":"This webpack plugin integrates Flow type checking directly into the Webpack build process. On webpack startup, it automatically starts or restarts a Flow server, and subsequently runs `flow status` after each build. The package is currently at version 0.1.8 and was last published over a year ago, indicating it is no longer actively maintained. It was explicitly marked as \"experimental\" in its documentation. Key differentiators include its ability to pass custom Flow arguments, control Flow server restarts, specify a custom Flow binary path, and optionally fail the webpack build if Flow type checks produce errors. Given its age and the low version number, it is primarily compatible with older Webpack and Node.js environments and does not follow modern module conventions (e.g., ESM). Developers should be aware of its unmaintained status and consider alternatives for current projects.","status":"abandoned","version":"0.1.8","language":"javascript","source_language":"en","source_url":"https://github.com/diegodurli/flow-status-webpack-plugin","tags":["javascript","flow-status","flowtype.js","webpack"],"install":[{"cmd":"npm install flow-status-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add flow-status-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add flow-status-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This plugin requires Flow (flow-bin) to be installed separately in your project or globally for type checking. It does not manage Flow's installation.","package":"flow-bin","optional":false},{"reason":"This is a webpack plugin and requires webpack as a peer dependency for its functionality.","package":"webpack","optional":false}],"imports":[{"note":"The package is designed for CommonJS (require) imports, reflecting its older codebase. ESM imports are not supported.","wrong":"import FlowStatusWebpackPlugin from 'flow-status-webpack-plugin';","symbol":"FlowStatusWebpackPlugin","correct":"const FlowStatusWebpackPlugin = require('flow-status-webpack-plugin');"}],"quickstart":{"code":"const path = require('path');\nconst webpack = require('webpack');\nconst FlowStatusWebpackPlugin = require('flow-status-webpack-plugin');\n\nmodule.exports = {\n  mode: 'development',\n  entry: './src/index.js',\n  output: {\n    filename: 'bundle.js',\n    path: path.resolve(__dirname, 'dist'),\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        exclude: /node_modules/,\n        use: {\n          loader: 'babel-loader',\n          options: {\n            presets: ['@babel/preset-env', '@babel/preset-flow']\n          }\n        }\n      }\n    ]\n  },\n  plugins: [\n    // In modern webpack, new webpack.NoErrorsPlugin() is deprecated/removed.\n    // If using an older webpack, uncomment this line:\n    // new webpack.NoErrorsPlugin(),\n    new FlowStatusWebpackPlugin({\n      failOnError: true, // Fail the webpack build if Flow reports errors\n      restartFlow: true, // Always restart the Flow server with each build\n      binaryPath: path.resolve(__dirname, 'node_modules/.bin/flow'), // Specify local Flow binary\n      onSuccess: function(stdout) { console.log('Flow is happy!\\n', stdout); },\n      onError: function(stdout) { console.error('Flow found errors!\\n', stdout); }\n    })\n  ]\n};\n\n// To run:\n// 1. Create src/index.js with some Flow code, e.g.:\n//    // @flow\n//    function add(a: number, b: number): number {\n//      return a + b;\n//    }\n//    const result: string = add(1, 2); // This will cause a Flow error (number assigned to string)\n//    console.log(result);\n// 2. npm install --save-dev webpack webpack-cli flow-status-webpack-plugin @babel/core babel-loader @babel/preset-env @babel/preset-flow flow-bin\n// 3. Initialize Flow: npx flow init\n// 4. Run webpack: npx webpack","lang":"javascript","description":"This quickstart demonstrates basic integration of the FlowStatusWebpackPlugin into a webpack configuration. It includes babel for Flow syntax stripping, configures the plugin to fail on Flow errors, and provides success/error callbacks. It highlights the use of `failOnError`, `restartFlow`, and `binaryPath` options."},"warnings":[{"fix":"Remove `new webpack.NoErrorsPlugin()`. For Webpack 2/3, use `new webpack.NoEmitOnErrorsPlugin()`. For Webpack 4+, `NoEmitOnErrorsPlugin` is often enabled by default in production mode, and handling build failures might require custom logic or relying on the plugin's own `failOnError` option in conjunction with Webpack's error handling.","message":"The `webpack.NoErrorsPlugin` used in the documentation's `failOnError` example is deprecated since Webpack 2 and removed in Webpack 4 and later. Using it in newer Webpack versions will cause configuration errors.","severity":"breaking","affected_versions":">=0.1.0 (with Webpack >=2.0)"},{"fix":"Thoroughly test compatibility with your specific environment. Consider alternative, more actively maintained Flow-Webpack integration solutions (e.g., `flow-babel-webpack-plugin`, `flowtype-webpack-plugin`, or `flow-webpack-next-plugin`) or migrating to TypeScript if long-term stability and support are critical.","message":"The plugin is marked as 'Still experimental' in its own README and has not been updated in over a year. This indicates a lack of ongoing maintenance and potential compatibility issues with newer versions of Node.js, Webpack, or Flow itself.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Ensure `flow-bin` is installed (`npm install --save-dev flow-bin`) and run `npx flow init` in your project root to create a `.flowconfig` file before using the plugin.","message":"This plugin requires Flow (specifically the `flow-bin` package and a `.flowconfig` file) to be installed and initialized separately in your project. It does not manage the Flow toolchain itself.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev flow-status-webpack-plugin` or `yarn add --dev flow-status-webpack-plugin`.","cause":"The package `flow-status-webpack-plugin` is not installed or incorrectly referenced in `webpack.config.js`.","error":"Error: Can't resolve 'flow-status-webpack-plugin'"},{"fix":"Add `const webpack = require('webpack');` at the top of your `webpack.config.js` if you are using Webpack utility plugins.","cause":"The `webpack` module was not imported when `new webpack.NoErrorsPlugin()` (or similar `webpack` utility) was used in `webpack.config.js`.","error":"ReferenceError: webpack is not defined"},{"fix":"Ensure `flow-bin` is installed (`npm install --save-dev flow-bin`) and run `npx flow init` in your project root to initialize Flow. Check Flow's own logs for startup errors if the issue persists.","cause":"The Flow type checker has not been initialized or the Flow server failed to start, preventing the plugin from checking types.","error":"Flow server is not running."},{"fix":"In older Webpack (v1), combine `failOnError: true` with `new webpack.NoErrorsPlugin()`. In newer Webpack versions where `NoErrorsPlugin` is removed, you may need a custom build hook or a different plugin (e.g., `webpack-fail-plugin`) to truly halt the build process based on Flow errors.","cause":"The `failOnError` option in `FlowStatusWebpackPlugin` only makes the *plugin* emit an error. If not combined with an appropriate Webpack error handling mechanism (like `webpack.NoErrorsPlugin` in older Webpack, or a custom build failure check), Webpack might still emit bundles.","error":"webpack build succeeds despite Flow errors when `failOnError: true` is set."}],"ecosystem":"npm"}