Skip to content

Unable to import in TS project with "moduleResolution": "NodeNext", #198

Open
@cyberwombat

Description

@cyberwombat

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

NA

Plugin version

4.0.0

Node.js version

16.17

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

12.4

Description

I am updating my TS code to use ESM which requires having "moduleResolution": "NodeNext" or "moduleResolution": "Node16". In doing so my code (whether I use import S... or import * as S.... now gives me errors when I do:

S.object() or S.string() etc with:

Property 'object' does not exist on type 'typeof import("/.../node_modules/fluent-json-schema/types/FluentJSONSchema")'.ts(2339)

I can provide a sample repo but I think if you just add `"moduleResolution": "NodeNext"`` to any TS sample it should do it.

Steps to Reproduce

Use `"moduleResolution": "NodeNext"`` in a TS project

Expected Behavior

No response

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