Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mshima opened this issue Oct 4, 2022 · 1 comment · May be fixed by esbuild-kit/esm-loader#40 or esbuild-kit/esm-loader#56

Comments

@mshima
Copy link

mshima commented Oct 4, 2022

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.

@privatenumber
Copy link
Owner

Closing as a duplicate of #135

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants