vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Error: Attempted to get parent of root folder "/"

Open nperez0111 opened this issue 5 months ago • 2 comments

Describe the bug

I keep getting failures of it looking up directories when starting the vitest extension in VS Code.

Reproduction

https://github.com/TypeCellOS/BlockNote/

Output

[INFO 9:34:39 AM] [v0.0.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 9:34:40 AM] [API] Resolving workspace configs: vitest.workspace.ts
[INFO 9:34:41 AM] [TERMINAL] Initiated ws connection via ws://localhost:57840
[INFO 9:34:41 AM] [TERMINAL] Starting Vitest v2.1.9 (blockNote/vitest.workspace.ts) in the terminal: node /Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/worker.js;
[INFO 9:34:41 AM] [TERMINAL] Shell integration is initiated.
[INFO 9:34:42 AM] [API] Vitest v2.1.9 (blockNote/vitest.workspace.ts) terminal process 65980 created
[INFO 9:34:42 AM] [API] Resolving configs: tests/vite.config.ts, playground/vite.config.ts, xl-pdf-exporter/vite.config.ts, mantine/vite.config.ts, xl-docx-exporter/vite.config.ts, code-block/vite.config.ts, ariakit/vite.config.ts, react/vite.config.ts, server-util/vite.config.ts, xl-ai-server/vite.config.ts, xl-ai/vite.config.ts, core/vite.config.ts, core/vite.config.bundled.ts, shadcn/vite.config.ts, xl-email-exporter/vite.config.ts, xl-multi-column/vite.config.ts, xl-odt-exporter/vite.config.ts, 01-ui-elements-remove/vite.config.ts, 17-advanced-tables-2/vite.config.ts, 12-static-formatting-toolbar/vite.config.ts, 03-formatting-toolbar-block-type-items/vite.config.ts, 07-suggestion-menus-slash-menu-component/vite.config.ts, 01-tiptap-arrow-conversion/vite.config.ts, 07-converting-blocks-to-odt/vite.config.ts, 06-converting-blocks-to-docx/vite.config.ts, 11-uppy-file-panel/vite.config.ts, 10-suggestion-menus-grid-mentions/vite.config.ts, 08-converting-blocks-to-react-email/vite.config.ts, 15-advanced-tables/vite.config.ts, 08-suggestion-menus-emoji-picker-columns/vite.config.ts, 01-converting-blocks-to-html/vite.config.ts, 09-suggestion-menus-emoji-picker-component/vite.config.ts, 02-formatting-toolbar-buttons/vite.config.ts, 05-converting-blocks-to-pdf/vite.config.ts, 04-converting-blocks-from-md/vite.config.ts, 02-converting-blocks-from-html/vite.config.ts, 03-converting-blocks-to-md/vite.config.ts, react-custom-blocks/vite.config.ts, draggable-inline-content/vite.config.ts, 04-pdf-file-block/vite.config.ts, 06-toggleable-blocks/vite.config.ts, 03-font-style/vite.config.ts, react-custom-styles/vite.config.ts, react-custom-inline-content/vite.config.ts, 02-suggestion-menus-mentions/vite.config.ts, 01-alert-block/vite.config.ts, 05-alert-block-full-ux/vite.config.ts, 02-liveblocks/vite.config.ts, 05-comments-with-sidebar/vite.config.ts, 01-partykit/vite.config.ts, 03-y-sweet/vite.config.ts, 04-comments/vite.config.ts, 06-ghost-writer/vite.config.ts, 14-experimental-mobile-formatting-toolbar/vite.config.ts, 07-forking/vite.config.ts, 05-side-menu-drag-handle-items/vite.config.ts, 01-minimal/vite.config.ts, 16-link-toolbar-buttons/vite.config.ts, 04-with-collaboration/vite.config.ts, 04-side-menu-buttons/vite.config.ts, 13-custom-ui/vite.config.ts, 06-suggestion-menus-slash-menu-items/vite.config.ts, 03-custom-ai-menu-items/vite.config.ts, 02-playground/vite.config.ts, 01-theming-dom-attributes/vite.config.ts, 06-code-block/vite.config.ts, 02-changing-font/vite.config.ts, 05-removing-default-blocks/vite.config.ts, 13-custom-paste-handler/vite.config.ts, testing/vite.config.ts, 09-shadcn/vite.config.ts, 11-custom-placeholder/vite.config.ts, 03-multi-column/vite.config.ts, 07-custom-code-block/vite.config.ts, 02-block-objects/vite.config.ts, 03-theming-css/vite.config.ts, 06-block-manipulation/vite.config.ts, 05-theming-css-variables-code/vite.config.ts, 12-multi-editor/vite.config.ts, 01-minimal/vite.config.ts, 08-ariakit/vite.config.ts, 07-selection-blocks/vite.config.ts, 04-theming-css-variables/vite.config.ts, react-vanilla-custom-inline-content/vite.config.ts, react-vanilla-custom-styles/vite.config.ts, react-vanilla-custom-blocks/vite.config.ts, 01-file-uploading/vite.config.ts, 04-rendering-static-documents/vite.config.ts, 02-saving-loading/vite.config.ts, 03-s3/vite.config.ts, 04-default-blocks/vite.config.ts, 10-localization/vite.config.ts
[INFO 9:34:42 AM] [API] Ignoring config tests/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config playground/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-pdf-exporter/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config mantine/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-docx-exporter/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config code-block/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config ariakit/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config server-util/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-ai-server/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-ai/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config core/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config core/vite.config.bundled.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config shadcn/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-email-exporter/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-multi-column/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config xl-odt-exporter/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-ui-elements-remove/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 17-advanced-tables-2/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 12-static-formatting-toolbar/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-formatting-toolbar-block-type-items/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 07-suggestion-menus-slash-menu-component/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-tiptap-arrow-conversion/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 07-converting-blocks-to-odt/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-converting-blocks-to-docx/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 11-uppy-file-panel/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 10-suggestion-menus-grid-mentions/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 08-converting-blocks-to-react-email/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 15-advanced-tables/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 08-suggestion-menus-emoji-picker-columns/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-converting-blocks-to-html/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 09-suggestion-menus-emoji-picker-component/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-formatting-toolbar-buttons/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-converting-blocks-to-pdf/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-converting-blocks-from-md/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-converting-blocks-from-html/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-converting-blocks-to-md/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-custom-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config draggable-inline-content/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-pdf-file-block/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-toggleable-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-font-style/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-custom-styles/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-custom-inline-content/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-suggestion-menus-mentions/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-alert-block/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-alert-block-full-ux/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-liveblocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-comments-with-sidebar/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-partykit/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-y-sweet/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-comments/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-ghost-writer/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 14-experimental-mobile-formatting-toolbar/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 07-forking/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-side-menu-drag-handle-items/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-minimal/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 16-link-toolbar-buttons/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-with-collaboration/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-side-menu-buttons/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 13-custom-ui/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-suggestion-menus-slash-menu-items/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-custom-ai-menu-items/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-playground/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-theming-dom-attributes/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-code-block/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-changing-font/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-removing-default-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 13-custom-paste-handler/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config testing/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 09-shadcn/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 11-custom-placeholder/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-multi-column/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 07-custom-code-block/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-block-objects/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-theming-css/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 06-block-manipulation/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 05-theming-css-variables-code/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 12-multi-editor/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-minimal/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 08-ariakit/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 07-selection-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-theming-css-variables/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-vanilla-custom-inline-content/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-vanilla-custom-styles/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config react-vanilla-custom-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 01-file-uploading/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-rendering-static-documents/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 02-saving-loading/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 03-s3/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 04-default-blocks/vite.config.ts because there is a workspace config in the parent folder
[INFO 9:34:42 AM] [API] Ignoring config 10-localization/vite.config.ts because there is a workspace config in the parent folder
[Error 9:34:42 AM] [Error Error] Fatal Error: Attempted to get parent of root folder "/".
Error: Fatal Error: Attempted to get parent of root folder "/".
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8709)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFolderTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8810)
	at Un.getOrCreateFileTestItem (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:8147)
	at Un.discoverAllTestFiles (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:7263)
	at Un.watchTestFilesInWorkspace (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:22:9121)
	at Ai._defineTestProfiles (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:24:2791)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async Ai.defineTestProfiles (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:24:1701)
	at async Ai.activate (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:24:7158)
	at async Uy (/Users/nickthesick/.cursor/extensions/vitest.explorer-1.28.2-universal/dist/extension.js:24:662)
	at async Pue._activate (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:16497)
	at async Pue._waitForDepsThenActivate (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:16439)
	at async Pue._initialize (file:///Applications/Cursor.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:136:15801)

Extension Version

1.28.2

Vitest Version

2.1.9

Validations

nperez0111 avatar Aug 29 '25 07:08 nperez0111

Same issue here, with following log:

...
[INFO 10:40:28 AM] [v0.0.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 10:40:29 AM] [API] Resolving configs: .../vite.config.ts
[INFO 10:41:13 AM] [API] Running Vitest v3.2.4 (.../vite.config.ts) with "Program Files\Volta\node.EXE .../.vscode/extensions/vitest.explorer-1.28.2/dist/worker.js"
[Error 10:41:19 AM] [Error Error] Fatal Error: Attempted to get parent of root folder "/".
Error: Fatal Error: Attempted to get parent of root folder "/".
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8709)
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8810)
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8810)
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8810)
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8810)
    at Un.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8810)
    at Un.getOrCreateFileTestItem (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:8147)
    at Un.discoverAllTestFiles (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:7263)
    at Un.watchTestFilesInWorkspace (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:22:9121)
    at Ai._defineTestProfiles (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:24:2791)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at Ai.defineTestProfiles (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:24:1701)
    at Ai.activate (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:24:7158)
    at Uy (...\.vscode\extensions\vitest.explorer-1.28.2\dist\extension.js:24:662)
    at _b.n (file:///.../VSCode-win32-x64-1.104.1/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13382)
    at _b.m (file:///.../VSCode-win32-x64-1.104.1/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13345)
    at _b.l (file:///.../VSCode-win32-x64-1.104.1/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12801)

Update:

About VSCode:

Version: 1.104.1
Commit: 0f0d87fa9e96c856c5212fc86db137ac0d783365
Date: 2025-09-17T23:36:24.973Z
Electron: 37.3.1
ElectronBuildId: 12404162
Chromium: 138.0.7204.235
Node.js: 22.18.0
V8: 13.8.258.31-electron.0
OS: Windows_NT x64 10.0.22621

I tested various versions and it seems that the version introducing this error is 1.26.4.

Note that before version 1.26.4, and at least from 1.12.1, another error prevents the extension to start:

[Error 10:23:44 AM] [Error RangeError] Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at get hasIndices (<anonymous>)
    at get flags (<anonymous>)
    at [Symbol.replace] (<anonymous>)
    at String.replace (<anonymous>)
    at qm.file (file:///.../VSCode-win32-x64-1.104.1/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:28:57817)
    at Ar.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.18.1\dist\extension.js:24:4333)
    at Ar.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.18.1\dist\extension.js:24:4348)
    at Ar.getOrCreateFolderTestItem (...\.vscode\extensions\vitest.explorer-1.18.1\dist\extension.js:24:4348)
...

damrem avatar Sep 18 '25 07:09 damrem

Hi! I had the same problem and found a temporary workaround.

In vitest.config.ts:

export default defineConfig({
  root: import.meta.dirname, 
  // ... rest of the config
})

By default, the root property in defineConfig is set to process.cwd(). Even though process.cwd() and import.meta.dirname seem to resolve to the same path at runtime in my environment, setting root to the latter solved the issue for me.

Hope this helps!

PBrnt avatar Nov 30 '25 18:11 PBrnt