Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports are wrongly typed with module node16 #388

Open
FabianFrank opened this issue Sep 1, 2023 · 0 comments
Open

Exports are wrongly typed with module node16 #388

FabianFrank opened this issue Sep 1, 2023 · 0 comments

Comments

@FabianFrank
Copy link

FabianFrank commented Sep 1, 2023

Due to export default ... the types announce a named export called "default", which indeed does not exist necessitating the following workaround:

import ajvTransformKeywordBorkedDefault from "ajv-keywords/dist/definitions/transform.js"

// moduleResolution: node16 workaround, the types erroneously have a named export "default" on the default export
const ajvTransformKeyword =
  ajvTransformKeywordBorkedDefault as unknown as typeof ajvTransformKeywordBorkedDefault.default

See similar issue ajv-validator/ajv#2132, but at least on ajv-validator the types and what is actually exported by the compiled JS still agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant