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

v23 does not support "extends" (TS6096) #625

Closed
mattyclarkson opened this issue Jul 18, 2018 · 9 comments
Closed

v23 does not support "extends" (TS6096) #625

mattyclarkson opened this issue Jul 18, 2018 · 9 comments

Comments

@mattyclarkson
Copy link

  • Issue

I have a tsconfig.json that uses the extends property:

{
  "extends": "../tsconfig",
  "compilerOptions": {
    "module": "CommonJS",
    "removeComments": false,
    "resolveJsonModule": false,
  }
}

Using ts-jest v23 the following error is thrown:

Some errors occurred while attempting to read from /Users/mattyclarkson/git/github/ef-carbon/url/test/tsconfig.json: message TS6096: File '../tsconfig' does not exist.

Works with v22.

  • Expected behavior

Should allow extended configurations

  • Output from your debug log

No Output

  • Link to a minimal repo that reproduces this issue

https://github.com/ef-carbon/url

  • Optional (but highly recommended) - Configure Travis (or your favorite system) with the minimal repo

CircleCI is working on the repository

@huafu
Copy link
Collaborator

huafu commented Jul 19, 2018

Try replacing "extends": "../tsconfig" with "extends": "../tsconfig.json" (notice the .json at the end)

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jul 20, 2018

I also noticed this when upgrading from 22.4.6 to 23. I think there must be something in v23 that breaks this extend. I think we should check why this is broken but not in 22.4.6

@huafu
Copy link
Collaborator

huafu commented Jul 20, 2018

@ahnpnl have to check, but if TS moved from a require() to a readFile[Sync](), then removing the extension would break. But typescript also would break when invoking tsc.

@wfortin
Copy link

wfortin commented Jul 20, 2018

It seems that relative paths are broken. Using a extends with an absolute path works.

@mattyclarkson
Copy link
Author

@huafu I don't actually run tsc with the test/tsconfig.json, it's just for testing so it's the one that ts-jest sees. However, I do have a lint/tsconfig.json that TS Lint reads that has exactly the same extends property and accepts it fine. Maybe the way that ts-jest uses the readConfig API might be different to the way tsc and TS Lint do it? It's odd that TS would break backwards compatiblity like that. The manual even shows to not include the .json

@huafu
Copy link
Collaborator

huafu commented Jul 24, 2018

thanks @mattyclarkson for the info on tslint, I'll look at the given reader there to see which one they use and will try to use

@huafu
Copy link
Collaborator

huafu commented Aug 4, 2018

@mattyclarkson it is fixed in 23.1.2, just checked:
screen shot 2018-08-04 at 07 56 39

@huafu huafu closed this as completed Aug 4, 2018
@denizdogan
Copy link

I had an issue today where I used "extends": "tsconfig.base.json" and got an error telling me it could not be found. The solution was to change it to "./tsconfig.base.json". Hopefully this helps someone.

@michaelprescott
Copy link

I guess the problem is back. Tried a variety of path revisions, no luck so far. For me it's occurring as a validation warning when running jest --coverage:
"Unknown option "extends" with value "../../tsconfig.json" was found.
This is probably a typing mistake. Fixing it will remove this message."

Using:
jest: 28.1.3
ts-jest: 28.0.8

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

No branches or pull requests

6 participants