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

Error: Circularity detected while resolving configuration #5326

Closed
6 tasks done
13OnTheCode opened this issue Mar 2, 2024 · 2 comments · Fixed by #5384
Closed
6 tasks done

Error: Circularity detected while resolving configuration #5326

13OnTheCode opened this issue Mar 2, 2024 · 2 comments · Fixed by #5384
Labels
feat: typecheck Issues and PRs related to typechecking feature p3-minor-bug An edge case that only affects very specific usage (priority) upstream

Comments

@13OnTheCode
Copy link

13OnTheCode commented Mar 2, 2024

Describe the bug

If the extends configuration in tsconfig.json is an array, and each item in it further extends another configuration, it will cause vitest --typecheck.only to run and fail, with the following error message:

Error: Circularity detected while resolving configuration: C:\Users\13\Developer\13OnTheCode\types\node_modules\.pnpm\@13onthecode+typescript-config@0.0.8_typescript@5.3.3\node_modules\@13onthecode\typescript-config\base\tsconfig.json
 ❯ Ae node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:9189
 ❯ te node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:10122
 ❯ Ae node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:9293
 ❯ te node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:10122
 ❯ ie node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:10838
 ❯ $e node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:228:10943
 ❯ getTsconfig node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:268:20
 ❯ Typechecker.prepare node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/index.c1V_jzyZ.js:641:36
 ❯ createWorkspaceTypechecker node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:9166:19
 ❯ Object.runTests node_modules/.pnpm/vitest@1.3.1_@vitest+ui@1.3.1/node_modules/vitest/dist/vendor/cac.wWT9ELdg.js:9199:7

Reproduction

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

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
    Memory: 16.47 GB / 31.94 GB
  Binaries:
    Node: 21.1.0 - ~\AppData\Local\pnpm\node.EXE
    npm: 10.2.0 - ~\AppData\Local\pnpm\npm.CMD
    pnpm: 8.15.4 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Chromium (122.0.2365.59)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @vitest/ui: ^1.3.1 => 1.3.1
    vitest: ^1.3.1 => 1.3.1

Used Package Manager

pnpm

Validations

@hi-ogawa
Copy link
Contributor

hi-ogawa commented Mar 3, 2024

The error is from get-tsconfig https://github.com/privatenumber/get-tsconfig, so if this is really a bug, then it needs to fixed there. Here is a reproduction to directly run getTsconfig:

https://stackblitz.com/edit/vitest-dev-vitest-qatvm8?file=repro.mjs

@hi-ogawa hi-ogawa added upstream p3-minor-bug An edge case that only affects very specific usage (priority) feat: typecheck Issues and PRs related to typechecking feature and removed pending triage labels Mar 3, 2024
@mrazauskas
Copy link

mrazauskas commented Mar 6, 2024

One can simply use tsc --noEmit instead. Roughly this is the same what Vitest does internally. (And comes with the same limitations, see #3752).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: typecheck Issues and PRs related to typechecking feature p3-minor-bug An edge case that only affects very specific usage (priority) upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants