Skip to content

es module: Dynamic require of "esbuild-register/dist/node" is not supported #86

Description

@wighawag

I am building a command line tool that load ts files and I make use of esbuild-register to make it work

It work fine when the tool is compiled to a cjs file
but if I generate a es module instead, I get the following error when executing it :

Error: Dynamic require of "esbuild-register/dist/node" is not supported

Using tsup to build the cli and I use require to load the ts files

I tried to use import( instead of require but got the error):

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ...

any idea ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions