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

Vitest fails to resolve tsconfig extends #994

Closed
6 tasks done
michael-wolfenden opened this issue Mar 20, 2022 · 2 comments
Closed
6 tasks done

Vitest fails to resolve tsconfig extends #994

michael-wolfenden opened this issue Mar 20, 2022 · 2 comments
Labels

Comments

@michael-wolfenden
Copy link

Describe the bug

Given the following package.json

{
  "name": "vitest-test",
  "private": true,
  "license": "MIT",
  "type": "module",
  "main": "index.js",
  "scripts": {
    "test": "vitest",
    "test:ui": "vitest --ui",
    "test:run": "vitest run"
  },
  "devDependencies": {
    "@tsconfig/node14": "latest",
    "@vitest/ui": "latest",
    "vite": "latest",
    "vitest": "latest"
  },
  "stackblitz": {
    "startCommand": "npm run test:ui"
  }
}

and tsconfig.json

{
  "extends": "@tsconfig/node14"
}

Running vitest results in the following error:

 FAIL  test/basic.test.ts [ test/basic.test.ts ]
Error: failed to resolve "extends":"@tsconfig/node14" in /home/projects/vitest-dev-vitest-ujcycp/tsconfig.json
 ❯ resolveExtends node_modules/vite/dist/node/chunks/dep-9c153816.js:22266:11
 ❯ parseExtends node_modules/vite/dist/node/chunks/dep-9c153816.js:22250:34
 ❯ parse$e node_modules/vite/dist/node/chunks/dep-9c153816.js:22201:24
 ❯ async loadTsconfigJsonForFile node_modules/vite/dist/node/chunks/dep-9c153816.js:22547:24
 ❯ async transformWithEsbuild node_modules/vite/dist/node/chunks/dep-9c153816.js:22380:36
 ❯ async TransformContext.transform node_modules/vite/dist/node/chunks/dep-9c153816.js:22468:32
 ❯ async Object.transform node_modules/vite/dist/node/chunks/dep-9c153816.js:38334:30
 ❯ async doTransform node_modules/vite/dist/node/chunks/dep-9c153816.js:53030:29

If I remove "extends": "@tsconfig/node14" from tsconfig.json, the tests run successfully

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-ujcycp

System Info

N/A

Used Package Manager

yarn

Validations

@Kingwl
Copy link

Kingwl commented Apr 12, 2022

I think this one has been fixed in upstream and updated via 68b186c.

@sheremet-va
Copy link
Member

I think this one has been fixed in upstream and updated via 68b186c.

Hurray! Closing issue :)

chaii3 pushed a commit to chaii3/vitest that referenced this issue May 13, 2022
Co-authored-by: Jelf <haichao.liang@parameters.cn>
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants