Skip to content

Exports are wrongly typed with module node16 #388

@FabianFrank

Description

@FabianFrank

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions