Skip to content

Error: Circularity detected while resolving configuration #5326

@13OnTheCode

Description

@13OnTheCode

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feat: typecheckIssues and PRs related to typechecking featurep3-minor-bugAn edge case that only affects very specific usage (priority)upstream

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions