Cannot use this in a project with module
and moduleResolution
of nodenext
/node16
#163
Labels
module
and moduleResolution
of nodenext
/node16
#163
When using this library in a project with
module
andmoduleResolution
ofnodenext
ornode16
, TypeScript produces compilation errors stemming from Superstruct:It seems that Superstruct is a ESM library (because its
type
field inpackage.json
is "module"), but its published TypeScript definition files aren't ESM-compatible. This is tracked a bug here: ianstormtaylor/superstruct#1160Unfortunately you cannot just change the file extensions, because this library (
utils
) isn't an ESM library, and you can't import an ESM library in a CommonJS library or else you get an error from TypeScript:So in order to use Superstruct, we either need to fork and fix Superstruct so that it's CommonJS-compatible, or we need to convert this library to use ESM (and make sure it's CommonJS-compatible).
I've started a branch which does both of these things here:
convert-to-esm
The text was updated successfully, but these errors were encountered: