Skip to content

Vitest found multiple config files although there are no config files #610

@bennycode

Description

@bennycode

Describe the bug

I have a Lerna monorepository where vitest is installed on the top-level package.json file. My monorepo has a "packages" directory with 17 packages inside. Each package is configured like this (only package.json & tsconfig.json files inside, no vitest.config.json!):

{
  "dependencies": {
    
  },
  "files": [

  ],
  "license": "MIT",
  "main": "src/index.js",
  "name": "@something/backtest",
  "peerDependencies": {
    "vitest": "*"
  },
  "private": true,
  "scripts": {
    "build": "tsc",
    "clean": "rimraf --glob src/**/*{.js,.js.map,.d.ts}",
    "dist": "npm run clean && npm run build",
    "start": "npm run test:types && node --no-warnings=ExperimentalWarning --loader ts-node/esm src/start.ts",
    "test": "npm run test:deps && npm run test:types && npm run test:units",
    "test:deps": "depcheck --quiet",
    "test:types": "tsc --noEmit",
    "test:units": "vitest run --passWithNoTests"
  },
  "type": "module",
  "version": "0.0.0"
}

Even though there is no config file, I am getting the following message from the Vitest VS Code extension:

Vitest found multiple config files. The extension will use only the first 3 due to performance concerns. Consider using a workspace configuration to group your configs or increase the limit via "vitest.maximumConfigs" option.

The extension wants me to create a vitest.workspace.ts configuration but such configuration just references other Vitest configs which I don't have.

Reproduction

Create a monorepo with more than 3 packages inside. Use Vitest command inside each of the project's package.json files (without providing a vitest.config.json file).

Output

[INFO 4:17:20 PM] [v1.16.1] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 4:17:20 PM] [API] Resolving configs: strategy-panic-sell/package.json/test:units, exchange-coinbase/package.json/test:units, exchange-alpaca-mock/package.json/test:units, exchange-binance-mock/package.json/test:units, strategy-rebuy/package.json/test:units, backtest/package.json/test:units, backtest-cli/package.json/test:units, exchange-alpaca/package.json/test:units, exchange-ig/package.json/test:units, candle-importer/package.json/test:units, market-analysis/package.json/test:units, lambot/package.json/test:units, strategy-stop-loss/package.json/test:units, strategy-buy-sell/package.json/test:units, core/package.json/test:units, exchange-ig-mock/package.json/test:units, exchange-binance/package.json/test:units
[INFO 4:17:20 PM] [API] Running Vitest v2.1.8 (strategy-panic-sell/package.json/test:units) with "node /Users/bennycode/.vscode/extensions/vitest.explorer-1.16.1/dist/worker.js"
[INFO 4:17:20 PM] [API] Running Vitest v2.1.8 (exchange-coinbase/package.json/test:units) with "node /Users/bennycode/.vscode/extensions/vitest.explorer-1.16.1/dist/worker.js"
[INFO 4:17:20 PM] [API] Running Vitest v2.1.8 (exchange-alpaca-mock/package.json/test:units) with "node /Users/bennycode/.vscode/extensions/vitest.explorer-1.16.1/dist/worker.js"
[INFO 4:17:20 PM] [API] Watching packages/strategy-panic-sell/package.json/test:units
[INFO 4:17:20 PM] [VSCODE] Watching typedtrader with pattern **/*
[INFO 4:17:20 PM] [API] Watching packages/exchange-coinbase/package.json/test:units
[INFO 4:17:20 PM] [API] Watching packages/exchange-alpaca-mock/package.json/test:units

Extension Version

1.16.1

Vitest Version

2.0.5

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions