Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FlowWebpackPlugin
✓ const FlowWebpackPlugin = require('flow-webpack-plugin')
✗ import FlowWebpackPlugin from 'flow-webpack-plugin'
The package does not provide ES module exports; CommonJS require is required. There is no default or named import.
FlowWebpackPlugin
✓ const FlowWebpackPlugin = require('flow-webpack-plugin')
✗ const { FlowWebpackPlugin } = require('flow-webpack-plugin')
The export is a single constructor function, not a named export. Destructuring will result in undefined.
Configuration options
✓ new FlowWebpackPlugin({ failOnError: true, flowPath: require('flow-bin') })
✗ new FlowWebpackPlugin({ failOnError: 'true' })
failOnError and failOnErrorWatch are boolean; passing string 'true' will be truthy but incorrect.
Example webpack configuration enabling Flow type-checking with error-on-fail settings.
const FlowWebpackPlugin = require('flow-webpack-plugin');
module.exports = {
plugins: [
new FlowWebpackPlugin({
failOnError: true,
failOnErrorWatch: false,
reportingSeverity: 'error',
printFlowOutput: true,
flowPath: require.main.require('flow-bin'),
flowArgs: ['--color=always'],
verbose: false
}),
],
};
Errors
Common errors & fixes
TypeError: FlowWebpackPlugin is not a constructor
Using ES module import or destructuring require.
fixUse const FlowWebpackPlugin = require('flow-webpack-plugin'); then new FlowWebpackPlugin(...) Error: Cannot find module 'flow-bin'
flow-bin not installed and no flowPath option provided.
fixInstall flow-bin: npm install --save-dev flow-bin, or configure flowPath to a Flow binary.
Flow returned exit code X but webpack continues
failOnError or failOnErrorWatch not set to true.
fixSet failOnError: true (or failOnErrorWatch: true for watch mode) in plugin options.
Audit
Dependencies
flow-binoptionalFlow binary for type checking; not a hard dependency if flow is installed globally or via other means.