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

bug(@nx/js): tsconfig extends does not support Node.js style resolution. #28417

Closed
1 of 4 tasks
douglasduteil opened this issue Oct 12, 2024 · 4 comments · Fixed by #28535
Closed
1 of 4 tasks

bug(@nx/js): tsconfig extends does not support Node.js style resolution. #28417

douglasduteil opened this issue Oct 12, 2024 · 4 comments · Fixed by #28535

Comments

@douglasduteil
Copy link

douglasduteil commented Oct 12, 2024

Current Behavior

Resolving the extends of a tsconfig is path relative only.

Expected Behavior

\following https://www.typescriptlang.org/tsconfig/#extends
On can extends from a node module

GitHub Repo

No response

Steps to Reproduce

  1. install @tsconfig/strictest (or another github.com/tsconfig/bases)
  2. extends your tsconfig with it "extends": "@tsconfig/strictest/tsconfig.json",
  3. Run a nx build
    💥

Nx Report


 NX   Report complete - copy this into the issue template

Node           : 20.18.0
OS             : linux-x64
Native Target  : x86_64-linux
pnpm           : 9.12.1

nx             : 20.0.0
@nx/js         : 20.0.0
@nx/eslint     : 20.0.0
@nx/workspace  : 20.0.0
@nx/cypress    : 20.0.0
@nx/devkit     : 20.0.0
@nx/next       : 20.0.0
@nx/react      : 20.0.0
@nx/web        : 20.0.0
@nx/webpack    : 20.0.0
typescript     : 5.6.2
---------------------------------------
Registered Plugins:
@nx/next/plugin

Failure Logs


 Error: ENOENT: no such file or directory, stat '/home/x/y/z/packaages/config/typescript/@tsconfig/strictest/tsconfig.json'
          at statSync (node:fs:1666:25)
          at getTsConfigCacheKey [...]

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

See https://www.typescriptlang.org/tsconfig/#extends

@kylecarhart
Copy link

I am having this issue as well. Any workarounds?

@leosvelperez
Copy link
Member

Thanks for reporting this!

@kylecarhart given the current implementation only resolves relative paths, the only workaround would be to set a relative path to the tsconfig file you're extending from.

I'll work on a fix to support this use case.

@douglasduteil
Copy link
Author

Thanks @leosvelperez
I can't wait to try it 👏

Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

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

Successfully merging a pull request may close this issue.

4 participants