Skip to content

Multiple declarations of __esbuild_register_import_meta_url__ #82

Description

@marionebl

After bumping to 3.4.1 from 3.3.3 I'm encountering the following exception in cases where esbuild-register is registered more than once.

SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared​​

The workaround for this in cases where I can control the registration is

if (!('.ts' in require.extensions)) {
  require('esbuild-register/dist/node').register();
}

In some cases I can not control the registration though so the discussed workaround can't be applied.
This is the case e.g. for jest configuration files authored in TypeScript.

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