TypeScript issue: moduleResolution:NodeNext
doesn’t work with this library
#271
Labels
enhancement
New feature or request
The problem
tsconfig.json
:TypeScript code:
Result – error from tsc:
Solutions
Quickest fix – change
package.json
:In the long run, you don’t need
"main"
,"module"
and"types"
(anywhere!) anymore, as these are superseded by"exports"
and modern TypeScript.d.ts
resolution. You only have to rename:Possibly useful
"exports"
: https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports.d.mts
works with older TypeScript versions. There, you may have some success with thepackage.json
property"typesVersions"
(but in general it’s better if you don’t use it and only rely on"exports"
): https://2ality.com/2021/06/typescript-esm-nodejs.htmlThe text was updated successfully, but these errors were encountered: