flow icon indicating copy to clipboard operation
flow copied to clipboard

Support for import assertions

Open Ashoat opened this issue 3 years ago • 0 comments

Proposal

As of Node 16.14, Node's experimental support for ESM requires that imports of JSON modules are annotated with import assertions. Node docs for Node 18, Node 16

Flow is not currently able to parse this new syntax, either for static imports or for dynamic imports. As a result, it's not currently possible to use Flow with Node's experimental ESM support as of Node 16.14.

Use case

By adding support for import assertions (both for static imports as well as dynamic imports), Flow would make it possible to use Flow with ESM import syntax running natively on Node. Node 16.14 and Node 18 (with ESM support listed as "stable") both require import assertions for imports of JSON modules, which makes it impossible to use Flow with modern versions of Node using ESM natively.

Ashoat avatar May 22 '22 16:05 Ashoat