vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
734 stars 83 forks source link

Debugger grinds to a halt with large unrelated files present #433

Open hahanein opened 1 month ago

hahanein commented 1 month ago

Describe the bug

When there are many large JavaScript files present in a dist/ directory the debugger will attach, sit there for a long time and terminate unexpectedly.

I am using vitest as a test runner for a web application. I am not using vite. However, dist/ is indeed where all build artifacts are moved to.

Of course, most of the files in that directory were stale and should have been removed (automatically). But, the presence of a dist/ directory in my situation is pure chance. Why is vitest monitoring this directory as "outFiles"?

In any case, it took many hours for me to spot this error.

Reproduction

  1. Create a project with vitest installed and a single test module
  2. Create a dist directory and create many large JavaScript files in them
  3. Try to debug the test using the Visual Studio Code extension

Output

[INFO 12:28:14 PM] [DEBUG] Debugging started

Version

0.12.4

Validations

sheremet-va commented 1 month ago

Vitest uses the default pwa-node config, and outFiles is everything in the workspace: https://github.com/microsoft/vscode-js-debug/blob/main/OPTIONS.md#outfiles-1

Does it work if you add them to config.debugExclude? (This will also override the default value) I can also expose outFiles - or maybe we should override?