Skip to content

Conversation

@Excellencedev
Copy link

/claim #1282
/closes #1282

Fixes issue #1282 by making sure don't need to specify "paths" in tsconfig in order to import files from the root directory
Created 3 test cases to verify it works

TEST LOGS:

USER@DESKTOP-1PHUG1C MINGW64 ~/3D Objects/eval (fix-1282)
$ bun test tests/features/tsconfig-paths-resolution.test.tsx
bun test v1.2.23 (cf136713)

tests\features\tsconfig-paths-resolution.test.tsx:
✓ resolves imports using tsconfig paths aliases [1391.00ms]
✓ throws error when tsconfig path alias cannot be resolved (instead of trying jsdelivr)
✓ resolves imports using tsconfig baseUrl [609.00ms]

3 pass
0 fail
5 expect() calls
Ran 3 tests across 1 file. [3.97s]

@Excellencedev
Copy link
Author

@seveibar Please review

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@Excellencedev
Copy link
Author

@seveibar I have resolved comments

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename viaPaths, same thought as before


if (!unknownFilePath.startsWith("./") && !unknownFilePath.startsWith("../")) {
const viaTsconfig = resolveWithTsconfigPaths({
const resolvedPathFromPaths = resolveWithTsconfigPaths({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const resolvedPathFromPaths = resolveWithTsconfigPaths({
const resolvedPathFromTsconfigPaths = resolveWithTsconfigPaths({

@seveibar seveibar merged commit 03289bb into tscircuit:main Oct 16, 2025
11 checks passed
@Excellencedev
Copy link
Author

@seveibar Thanks for merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support imports that use tsconfig.json baseUrl

2 participants