{"id":20036,"library":"flow-webpack-plugin","title":"flow-webpack-plugin","description":"A webpack plugin that invokes the Flow type checker during each webpack compilation. Current version 1.2.0 is stable and actively maintained. It allows Webpack to exit with non-zero return codes if Flow validation fails, supports watch mode, and can reuse a project's existing flow-bin installation without requiring Flow to be on $PATH. Unlike per-file type-checkers, it runs Flow on the entire project.","status":"active","version":"1.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/happylynx/flow-webpack-plugin","tags":["javascript","webpack","flow","plugin","flowtype"],"install":[{"cmd":"npm install flow-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add flow-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add flow-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Flow binary for type checking; not a hard dependency if flow is installed globally or via other means.","package":"flow-bin","optional":true}],"imports":[{"note":"The package does not provide ES module exports; CommonJS require is required. There is no default or named import.","wrong":"import FlowWebpackPlugin from 'flow-webpack-plugin'","symbol":"FlowWebpackPlugin","correct":"const FlowWebpackPlugin = require('flow-webpack-plugin')"},{"note":"The export is a single constructor function, not a named export. Destructuring will result in undefined.","wrong":"const { FlowWebpackPlugin } = require('flow-webpack-plugin')","symbol":"FlowWebpackPlugin","correct":"const FlowWebpackPlugin = require('flow-webpack-plugin')"},{"note":"failOnError and failOnErrorWatch are boolean; passing string 'true' will be truthy but incorrect.","wrong":"new FlowWebpackPlugin({ failOnError: 'true' })","symbol":"Configuration options","correct":"new FlowWebpackPlugin({ failOnError: true, flowPath: require('flow-bin') })"}],"quickstart":{"code":"const FlowWebpackPlugin = require('flow-webpack-plugin');\n\nmodule.exports = {\n  plugins: [\n    new FlowWebpackPlugin({\n      failOnError: true,\n      failOnErrorWatch: false,\n      reportingSeverity: 'error',\n      printFlowOutput: true,\n      flowPath: require.main.require('flow-bin'),\n      flowArgs: ['--color=always'],\n      verbose: false\n    }),\n  ],\n};","lang":"javascript","description":"Example webpack configuration enabling Flow type-checking with error-on-fail settings."},"warnings":[{"fix":"Use CommonJS require: const FlowWebpackPlugin = require('flow-webpack-plugin');","message":"flow-webpack-plugin does not provide ES module exports; attempting to import with ESM syntax will fail.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set failOnError: true in options to make webpack compilation fail on Flow errors.","message":"The failOnError option defaults to false; flow errors will not cause webpack to exit with non-zero code unless explicitly set.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure flow-bin is installed as a devDependency or provide a valid flowPath option.","message":"If flow-bin is not installed, the plugin will throw unless flowPath option provides an alternative path.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.0':20 'activ':24 'allow':27 'bin':53 'checker':13,68 'code':36 'compil':17 'current':18 'entir':74 'exist':50 'exit':30 'fail':40 'file':65 'flow':2,11,38,52,57,71,78 'flow-bin':51 'flow-webpack-plugin':1 'flowtyp':80 'instal':54 'invok':9 'javascript':76 'maintain':25 'mode':43 'non':33 'non-zero':32 'path':61 'per':64 'per-fil':63 'plugin':4,7,79 'project':48,75 'requir':56 'return':35 'reus':46 'run':70 'stabl':22 'support':41 'type':12,67 'type-check':66 'unlik':62 'valid':39 'version':19 'watch':42 'webpack':3,6,16,28,77 'without':55 'zero':34","created_at":"2026-04-25T11:20:59.478482+00:00","updated_at":"2026-04-25T11:20:59.478482+00:00","problems":[{"fix":"Use const FlowWebpackPlugin = require('flow-webpack-plugin'); then new FlowWebpackPlugin(...)","cause":"Using ES module import or destructuring require.","error":"TypeError: FlowWebpackPlugin is not a constructor"},{"fix":"Install flow-bin: npm install --save-dev flow-bin, or configure flowPath to a Flow binary.","cause":"flow-bin not installed and no flowPath option provided.","error":"Error: Cannot find module 'flow-bin'"},{"fix":"Set failOnError: true (or failOnErrorWatch: true for watch mode) in plugin options.","cause":"failOnError or failOnErrorWatch not set to true.","error":"Flow returned exit code X but webpack continues"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/happylynx/flow-webpack-plugin","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/flow-webpack-plugin","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}