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

Cannot resolve extended configs in a Yarn workspace #76

Closed
1 of 2 tasks
nwalters512 opened this issue May 8, 2024 · 2 comments · Fixed by #77
Closed
1 of 2 tasks

Cannot resolve extended configs in a Yarn workspace #76

nwalters512 opened this issue May 8, 2024 · 2 comments · Fixed by #77
Labels
bug Something isn't working

Comments

@nwalters512
Copy link
Sponsor Contributor

Problem

Consider a repository using Yarn workspaces. There's a package @repository/tsconfig containing a file tsconfig.base.json. There's another package @repository/library with a file tsconfig.json that contains "extends": "@repository/tsconfig/tsconfig.base.json".

If I run getTsconfig('.') from within @repository/library (e.g. at the path ./packages/library, get-tsconfig fails with the following error:

Error: File '@repository/tsconfig/tsconfig.base.json' not found.

tsc itself will correctly process this, so I consider this to be a bug with get-tsconfig.

Additional context: this is happening in the context of tsx. However, I was able to isolate the problem to this package, and specifically to the changes introduced in #75.

Expected behavior

I would expect get-tsconfig to correctly resolve the tsconfig.json file in @repository/library.

Minimal reproduction URL

https://github.com/nwalters512/get-tsconfig-yarn-workspaces-reproduction

Version

4.7.4

Node.js version

v20.13.0

Package manager

yarn

Operating system

macOS

Contributions

  • I plan to open a pull request for this issue
  • I plan to make a financial contribution to this project
@nwalters512 nwalters512 added the bug Something isn't working label May 8, 2024
@nwalters512
Copy link
Sponsor Contributor Author

I think I've narrowed it down to an issue with passing relative paths instead of absolute ones. This is still an issue, as the tsx docs (https://tsx.is/usage) specifically show the usage of a relative path for TSX_TSCONFIG_PATH.

@smorimoto
Copy link

Same problem here. Thanks for digging deep and working on the patch @nwalters512!

Repository owner locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants