Skip to content

Importing a typescript file from a js file using extension fails. #344

@mshima

Description

@mshima

hello.mts:

const hello = 'hello';
export default hello;

static.mjs:

import hello from './hello.mjs';
console.log(hello);

Execute

node --loader @esbuild-kit/esm-loader static.mjs

Error

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/mshima/git/test/hello.mjs' imported from /Users/mshima/git/test/static.mjs

This is useful for allowJs option.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions