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

support multiple tsconfigs #265

Open
1 task
tommy-mitchell opened this issue Jul 12, 2023 · 4 comments
Open
1 task

support multiple tsconfigs #265

tommy-mitchell opened this issue Jul 12, 2023 · 4 comments
Labels
enhancement New feature or request tsconfig

Comments

@tommy-mitchell
Copy link

Bug description

My project has separate tsconfig.json files for source and test files. When setting up the paths compiler option, my IntelliSense correctly provides type information for imports, but tsx fails with the ERR_MODULE_NOT_FOUND error.

Reproduction

https://github.com/tommy-mitchell/tsx-repro

// test/test.ts
import assert from "node:assert";
import { foo } from "~/index.ts"; // Errors here
import type { Foo } from "~/types.ts";

assert.strictEqual(foo() as Foo, "bar");

Environment

System:
	OS: macOS 13.3.1
	CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
	Memory: 107.30 MB / 8.00 GB
	Shell: 5.9 - /bin/zsh
Binaries:
	Node: 18.16.1 - ~/.nvm/versions/node/v18.16.1/bin/node
	Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.1/bin/yarn
	npm: 9.5.1 - ~/.nvm/versions/node/v18.16.1/bin/npm
	pnpm: 8.6.7 - ~/.nvm/versions/node/v18.16.1/bin/pnpm
npmPackages:
	tsx: ^3.12.7 => 3.12.7

Can you work on a fix?

  • I’m interested in opening a pull request to address this issue.
@tommy-mitchell tommy-mitchell added bug Something isn't working pending triage labels Jul 12, 2023
@tommy-mitchell
Copy link
Author

Sorry for posting in the other issue, thought it'd be relevant because they were both about the paths option :) my bad.

@tommy-mitchell
Copy link
Author

Maybe this has to do with how @esbuild-kit/esm-loader loads tsconfig.json? At a glance, it looks like it's only loaded once per project: https://github.com/esbuild-kit/esm-loader/blob/13ce0ca4978635618bc65bc94f3c8f92131d45c1/src/utils.ts#L13-L23

@privatenumber privatenumber mentioned this issue Jul 15, 2023
21 tasks
@privatenumber privatenumber changed the title ERR_MODULE_NOT_FOUND when using paths in tsconfig.json with multiple tsconfigs support multiple tsconfigs Sep 14, 2023
@privatenumber privatenumber added enhancement New feature or request and removed pending triage bug Something isn't working labels Sep 14, 2023
@monolithed

This comment has been minimized.

@aoede3

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tsconfig
Projects
None yet
Development

No branches or pull requests

4 participants