Flow’s parser does not understand `export from` attributes (the `with { type: "json" }` syntax).
Author: sangafabriceCreated Dec 27, 2025Updated Jun 30, 2026
Labelsbugneeds triage
Flow version: 0.295.0
Expected behavior
According to MDN:
export fromsupports all features thatimportsupports — for example, import attributes.
So the following should be valid:
/** @file export.js */
export { default } from "./htmlhint.json" with { type: "json" };
/** @file index.js */
import ruleset from "./export.js";
console.log(ruleset);
Running:
node index.js
should output the contents of htmlhint.json as an object:
{ "tagname-lowercase": true }
And processing with Flow should succeed:
npx flow-remove-types --out-file ./export.out.js ./export.js --all
Expected result:
./export.js
↳ ./export.out.js
Actual behavior
Flow fails to parse the with { type: "json" } attribute on export from:
./export.js
↳ Syntax Error: ';' expected (2:42)
export { default } from "./htmlhint.json" with { type: "json" };
^
1: export { default } from "./htmlhint.json" with { type: "json" };
Source: facebook/flow