vitest-dev / vscode

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

v0.5.2 failing on my repo #293

Closed ffMathy closed 5 months ago

ffMathy commented 6 months ago

Describe the bug

Activating extension 'vitest.explorer' failed: Vitest failed to start: 
Error: The service was stopped

Reproduction

Repro will come soon.

System Info

System:
    OS: macOS 14.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 1.93 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.15.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.5.0 - /usr/local/bin/npm
    pnpm: 8.6.12 - /usr/local/bin/pnpm
  IDEs:
    VSCode: 1.87.2 - /opt/homebrew/bin/code
    Vim: 9.0 - /usr/bin/vim
    Xcode: 15.3/15E204a - /usr/bin/xcodebuild
  Browsers:
    Chrome: 122.0.6261.129
    Edge: 122.0.2365.92
    Safari: 17.4
  npmPackages:
    @vitejs/plugin-react: ^4.2.1 => 4.2.1
    @vitest/coverage-v8: ^1.3.1 => 1.3.1
    @vitest/ui: ^1.3.1 => 1.3.1
    vite: ^5.1.6 => 5.1.6
    vitest: ^1.4.0 => 1.4.0

Used Package Manager

pnpm

Validations

ffMathy commented 6 months ago

I just tried using #296 against my repo, and I get the following log output:

[INFO 21:42:21] [Vitest] Extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace. [INFO 21:42:21] [API] Vitest config {"folder":{"uri":{"$mid":1,"fsPath":"/Users/redacted/Documents/src/redacted","external":"file:///Users/redacted/Documents/src/redacted","path":"/Users/redacted/Documents/src/redacted","scheme":"file"},"name":"redacted","index":0},"id":"/Users/redacted/Documents/src/redacted/vitest.workspace.ts","vitestNodePath":"file:///Users/redacted/Documents/src/redacted/nodemodules/.pnpm/vitest@1.4.0@types+node@20.11.27_@vitest+ui@1.3.1_jsdom@24.0.0_less@4.1.3_stylus@0.59.0/node_modules/vitest/dist/node.js","version":"1.4.0"} [INFO 21:42:21] [API] Running Vitest: v1.4.0 (redacted) [INFO 21:42:22] [WORKER] onMessage {"type":"init","meta":[{"vitestNodePath":"file:///Users/redacted/Documents/src/redacted/nodemodules/.pnpm/vitest@1.4.0@types+node@20.11.27_@vitest+ui@1.3.1_jsdom@24.0.0_less@4.1.3_stylus@0.59.0/node_modules/vitest/dist/node.js","folder":"/Users/redacted/Documents/src/redacted","workspaceFile":"/Users/redacted/Documents/src/redacted/vitest.workspace.ts","id":"/Users/redacted/Documents/src/redacted/vitest.workspace.ts"}]} [INFO 21:42:22] [WORKER] initializing [INFO 21:42:22] [WORKER] loading vitest instance {"vitestNodePath":"file:///Users/redacted/Documents/src/redacted/nodemodules/.pnpm/vitest@1.4.0@types+node@20.11.27_@vitest+ui@1.3.1_jsdom@24.0.0_less@4.1.3_stylus@0.59.0/node_modules/vitest/dist/node.js","folder":"/Users/redacted/Documents/src/redacted","workspaceFile":"/Users/redacted/Documents/src/redacted/vitest.workspace.ts","id":"/Users/redacted/Documents/src/redacted/vitest.workspace.ts"} [INFO 21:42:22] [WORKER] importing vitest node file:///Users/redacted/Documents/src/redacted/nodemodules/.pnpm/vitest@1.4.0@types+node@20.11.27_@vitest+ui@1.3.1_jsdom@24.0.0_less@4.1.3_stylus@0.59.0/node_modules/vitest/dist/node.js [INFO 21:42:22] [WORKER] creating vitest instance

So it is freezing at await vitestNode.createVitest. It never terminates, nor throws an exception. How can I debug it further?

ffMathy commented 6 months ago

Interesting. I was suspecting something with the import. I had a .npmrc file which contained:

symlink=true

I deleted it, deleted node_modules and ran pnpm install again. That worked. Hmmm. Perhaps that's repro enough (just having symlink to true for PNPM).

ffMathy commented 6 months ago

I tried reproing the .npmrc thing with the sample repos. I couldn't make it re-occur. I suspect maybe my node_modules folder maybe got corrupted? It's just strange.

Any advice I can use to continue debugging is still useful.

sheremet-va commented 5 months ago

There is still no repro. Let's close this issue for now, I cannot give you more debugging tips unfortunately.