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

TS files in dependency require explicit .ts extension #33

Closed
vlovich opened this issue Jun 17, 2022 · 1 comment · Fixed by #34
Closed

TS files in dependency require explicit .ts extension #33

vlovich opened this issue Jun 17, 2022 · 1 comment · Fixed by #34
Labels

Comments

@vlovich
Copy link

vlovich commented Jun 17, 2022

I have the following:

scripts/
  program/
    package.json
    main.ts
  common/
    module.ts <-- exports someMethod

In my main.ts I have:

import { someMethod } from 'common/module'

This fails with

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '.../scripts/program/node_modules/common/module' imported from .../scripts/program/main.ts
Did you mean to import .../scripts/common/module.ts?

If I do:

import { someMethod } from 'common/module.ts'

then it works but VSCode is unhappy & highlights this as an error.

This mostly works with esbuild-node-loader without needing to do this.

@privatenumber
Copy link
Owner

This was fixed but seems the release had failed due to a GitHub API failure.

Just re-ran and released: https://github.com/esbuild-kit/esm-loader/releases/tag/v2.2.1

Try npm update or re-installing tsx to get the sub-dependency upgrade.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants