Skip to content

Unable to resolve path to module if name of tsconfig.my-reference.json is misspelled #415

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

Closed
DesselBane opened this issue Mar 27, 2025 · 2 comments · Fixed by #423
Closed

Comments

@DesselBane
Copy link

When a reference in the tsconfig.json is not found the eslint plugin import-x can not resolve any imports. I would expect there to be an error stating something like "One of the references in your tsconfig.json can not be found".

See this reproduction Repo for details. Commit 1 everything works Commit 2 is broken.

@JounQin
Copy link
Collaborator

JounQin commented Mar 27, 2025

Currently, as a resolver, it doesn't provide any error info, it just doesn't resolve successfully, but on the other hand, a broken tsconfig reference should not break other references resolution, so this indeed seems like a bug of unrs-resolver, I'll try to fix this incorrect behavior there.

By the way, would adding error info into ReolveResult make sense? cc @SukkaW

@JounQin
Copy link
Collaborator

JounQin commented Mar 29, 2025

I found tsc itself throws error on this, so I'd like to throw on this invalid tsconfig instead also.

 repro-import-resolver-non-existent-ts-config on  main [!+] ❯ p tsc -p . --noEmit
tsconfig.json:5:5 - error TS6053: File '/Users/JounQin/Workspaces/GitHub/repro-import-resolver-non-existent-ts-config/tsconfig.ups-this-is-misspelled.json' not found.

5     { "path": "./tsconfig.ups-this-is-misspelled.json" },
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in tsconfig.json:5

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

Successfully merging a pull request may close this issue.

2 participants