question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

V4.0.0-beta.0: extends in tsconfig.json does not work as expected.

See original GitHub issue

tsConfig.json

{
  "extends": "./.temp/tsconfig-base.json"
}

tsconfig-base.json


{
  "include": ["../src/**/*", "../types/**/*.d.ts", "./loader-types.d.ts", "./client-types.d.ts"],
  "exclude": ["../src/**/*.spec.ts", "../src/**/*.spec.js"],
  "compilerOptions": {
    "strict": true,
    "skipLibCheck": true,
    "module": "esnext",
    "target": "es6",
    "allowSyntheticDefaultImports": true,
    "moduleResolution": "node",
    "lib": ["dom", "es6", "dom.iterable", "scripthost"],
    "noEmitHelpers": true,
    "importHelpers": true,
    "inlineSources": true,
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "baseUrl": ".",
    "paths": {
      "~ngAppModule": ["./ng-app-module"]
    },
    "outDir": "../dist/",
    "rootDir": "../src"
  }
}

When I tried debugging this issue, it logs {"extends":"./.temp/tsconfig-base.json","compilerOptions":{}} at https://github.com/vuejs/vue-jest/blob/master/lib/compilers/typescript-compiler.js#L11

related to #118

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
IlCallocommented, Apr 29, 2020

From what I read, vue-jest v3 uses a very old package to resolve tsconfig.json, needed before TypeScript exposed config resolution features. This package doesn’t support configuration inheritance. A PR has been started, but never finished and merged.

I found this bug while making Quasar framework work nicely with TS and Jest, in which a esModuleInterop property from a preset configuration wasn’t being picked up in the extending configuration, while everything worked fine when adding the property directly on the former.

Anyway, seems like the new V4 will support ts-jest which should manage inheritance correctly (it used native TS configuration management), so I guess the problem will be solved in some time.

Cya!

2reactions
vegerotcommented, Nov 30, 2020

I am using "@vue/cli-service": "4.5.8", and still experience this issue.

To test I:

  1. Made a valid tsconfig.json (without extends), ran my test suite, and they passed
  2. moved tsconfig.json to tsconfig.base.json and created tsconfig.json with contents:
{
  "extends": "./tsconfig.base.json"
}
  1. Ran tests again, and they fail
Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending tsconfig.json file doesn't seem to extend anything
Anyway, it looks like that extending here doesn't work, or works differently than I expect. Any suggestion how to improve my setup? typescript ......
Read more >
Ajv: Another JSON Schema Validator - npm
Ajv compiles schemas to functions and caches them in all cases (using schema itself as a key for Map) or another function passed...
Read more >
aspect-build/rules_ts
Allows a tsconfig.json file to extend another file. Normally, you just give a single tsconfig.json file as the tsconfig attribute of a ts_library...
Read more >
material-ui/core/CHANGELOG.md - UNPKG
721, In the coming weeks, we will initiate our work on the [next major: v5](https://github.com/mui-org/material-ui/issues/20012). 722, You can expect the ...
Read more >
TSConfig Reference - Docs on every TSConfig option
In this case, TypeScript has provided no warning that download on SharedAlbum expected to override a function in the base class.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found