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 failed to start error on .d.ts files with v0.12.4 #429

Closed
4 tasks done
bennycode opened this issue Jul 4, 2024 · 0 comments
Closed
4 tasks done

Vitest failed to start error on .d.ts files with v0.12.4 #429

bennycode opened this issue Jul 4, 2024 · 0 comments

Comments

@bennycode
Copy link

bennycode commented Jul 4, 2024

Describe the bug

I downloaded v0.12.4 because it excludes d.ts config files by default. Unfortunately, it still crashes when opening my workspace.

Reproduction

  1. Put a Vitest TypeScript config (vitest.config.ts) in the root of your project
  2. Compile the config using tsc so that a dist/vitest.config.d.ts file is being created
  3. Reload the VS Code window to see if the VS code extension can be initialized (it will crash)

My vitest.config.ts:

import {defineConfig} from 'vitest/config';

export default defineConfig({
  test: {
    coverage: {
      exclude: ['src/demo'],
      include: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/cli.ts', '!**/index.ts', '!**/start*.ts'],
      provider: 'v8',
      reporter: ['html', 'lcov', 'text'],
    },
    environment: 'node',
    globals: true,
  },
});

Output

[INFO 9:03:45 AM] [v0.12.4] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 9:03:46 AM] [API] Running Vitest v1.6.0 (trading212-api/vitest.config.ts) with Node.js: /home/bennycode/.nvm/versions/node/v20.10.0/bin/node
[INFO 9:03:46 AM] [API] Running Vitest v1.6.0 (dist/vitest.config.d.ts) with Node.js: /home/bennycode/.nvm/versions/node/v20.10.0/bin/node
[INFO 9:03:46 AM] [API] Running Vitest v1.6.0 (dist/vitest.config.js) with Node.js: /home/bennycode/.nvm/versions/node/v20.10.0/bin/node
[Worker] failed to load config from /home/bennycode/dev/bennycode/trading212-api/dist/vitest.config.d.ts
[INFO 9:03:46 AM] [API] Vitest v1.6.0 (trading212-api/vitest.config.ts) process 5536 created
[Error 9:03:46 AM] [Error Error] Vitest failed to start: 

e
Error: Vitest failed to start: 

e
	at ChildProcess.f (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.4/dist/extension.js:18:5392)
	at ChildProcess.emit (node:events:518:28)
	at emit (node:internal/child_process:951:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
[INFO 9:03:46 AM] [API] Vitest v1.6.0 (dist/vitest.config.js) process 5546 created

Version

v0.12.4

Validations

@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant