Skip to content

Error when tsconfig.compilerOptions.module is unsupported by Node #1069

Description

@alcuadrado

Desired Behavior

Throw an error if tsconfig.compilerOptions.module is other than "commonjs".

Is this request related to a problem?

I have a command-line application that loads ts-node if it's installed. Users can use typescript for almost everything in that case.

The problem is that some users may accidentally set the tsconfig.compilerOptions.module to incompatible values. If this happens, the errors they get are pretty hard to understand.

Alternatives you've considered

We could validate this ourselves, but that would mean reimplementing how ts-node chooses which tsconfig.json to use.

Additional context

This request should be updated if ts-node were to support the new native ESM mode of node.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions