Skip to content

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

Description

@kidylee

Search Terms

ts-nodets-config.jsonextends

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions