nx icon indicating copy to clipboard operation
nx copied to clipboard

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

Open douglasduteil opened this issue 1 year ago • 2 comments

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
  • [x] Linux
  • [ ] Windows
  • [ ] Other (Please specify)

Additional Information

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

douglasduteil avatar Oct 12 '24 08:10 douglasduteil

I am having this issue as well. Any workarounds?

kylecarhart avatar Oct 18 '24 13:10 kylecarhart

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.

leosvelperez avatar Oct 18 '24 14:10 leosvelperez

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

douglasduteil avatar Oct 25 '24 10:10 douglasduteil

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[bot] avatar Nov 26 '24 00:11 github-actions[bot]