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

extends of tsconfig.json doesn't work when it reference to other package #2090

Closed
kidylee opened this issue Nov 23, 2023 · 2 comments · Fixed by #2091
Closed

extends of tsconfig.json doesn't work when it reference to other package #2090

kidylee opened this issue Nov 23, 2023 · 2 comments · Fixed by #2091

Comments

@kidylee
Copy link

kidylee commented Nov 23, 2023

Search Terms

ts-node ts-config.json extends

Expected Behavior

The issue is from extends keyword of tsconfig.json file, if it reference to a file based location is file, but if it is reference to a pacakge will occur extendee file not found error.

{
    "extends": "@tsconfig/node-lts/tsconfig.json"
}

In the meanwhile, tsc and jest.config.js doesn't have this issue.

Actual Behavior

╰─ pnpm test-ts                                                                                                                                                         ─╯

> ts-config-extends@1.0.0 test-ts /Users/anli/Developer/pp/ts-config-extends
> jest --config jest.config.ts --passWithNoTests

Error: Jest: Failed to parse the TypeScript config file /Users/anli/Developer/pp/ts-config-extends/jest.config.ts
  TSError: ⨯ Unable to compile TypeScript:
error TS6053: File '@tsconfig/node-lts/tsconfig.json' not found.
    at readConfigFileAndSetRootDir (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/jest-config@29.7.0_@types+node@20.9.4_ts-node@10.9.1/node_modules/jest-config/build/readConfigFileAndSetRootDir.js:116:13)
    at async readInitialOptions (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/jest-config@29.7.0_@types+node@20.9.4_ts-node@10.9.1/node_modules/jest-config/build/index.js:392:15)
    at async readConfig (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/jest-config@29.7.0_@types+node@20.9.4_ts-node@10.9.1/node_modules/jest-config/build/index.js:147:48)
    at async readConfigs (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/jest-config@29.7.0_@types+node@20.9.4_ts-node@10.9.1/node_modules/jest-config/build/index.js:424:26)
    at async runCLI (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/@jest+core@29.7.0_ts-node@10.9.1/node_modules/@jest/core/build/cli/index.js:151:59)
    at async Object.run (/Users/anli/Developer/pp/ts-config-extends/node_modules/.pnpm/jest-cli@29.7.0_@types+node@20.9.4_ts-node@10.9.1/node_modules/jest-cli/build/run.js:130:37)

Steps to reproduce the problem

pnpm i
pnpm test-js
pnpm test-ts

Minimal reproduction

https://github.com/kidylee/ts-config-issue-mre

Specifications

ts-node v10.9.1
node v19.7.0
compiler v5.3.2


@gtjamesa
Copy link

Looks to be an issue with TS 5.3

@edosrecki
Copy link
Contributor

Hi @kidylee, I believe it is safe to close this issue as a duplicate of #2076.

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

Successfully merging a pull request may close this issue.

3 participants