The original babel-plugin-transform-flow-strip-types hasn't shipped an update in 9 years. It breaks silently with Babel 7 and 8. Here's the drop-in fix — and a one-command migration path.
# Option A: swap the package (drop-in, 30 seconds) npm remove babel-plugin-transform-flow-strip-types npm install -D babel-plugin-transform-flow-strip-types-maintained # Option B: automated migration (updates package.json + .babelrc) npx flow-strip-migrate . # Option C: full Flow→TypeScript strip + config update npx flow-strip-migrate . --full
The package declares babel-core v6 as a peer dependency. Babel 7 ships as @babel/core, causing npm/yarn to flag unresolvable conflicts or install silently broken versions.
Babel 7 requires plugins to explicitly declare their syntax dependencies. The old package doesn't, causing SyntaxError: Unexpected token on Flow-typed files in certain configurations.
The original uses visitor patterns deprecated in Babel 7.x that produce warnings — and are outright broken in Babel 8's stricter AST validation.
The maintained fork fixes every known issue: correct peer deps, explicit syntax plugin, updated visitors, allowDeclareFields support, and import type / export type stripping.
Replace the old package with the maintained fork in package.json and update your .babelrc. Full instructions in the README.
Run npx flow-strip-migrate . — it updates your package.json, .babelrc, and all Babel config files automatically. No source code changes.
Run npx flow-strip-migrate . --full to also strip @flow pragmas, type annotations, and import type statements from all source files. Ideal for teams moving away from Flow entirely.
// Before { "plugins": ["transform-flow-strip-types"] } // After { "plugins": ["transform-flow-strip-types-maintained"] }