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

[Windows] Hangs at "Resolving Vitest..." forever #312

Closed
6 tasks done
Nithanim-Work opened this issue Mar 20, 2024 · 3 comments
Closed
6 tasks done

[Windows] Hangs at "Resolving Vitest..." forever #312

Nithanim-Work opened this issue Mar 20, 2024 · 3 comments

Comments

@Nithanim-Work
Copy link

Describe the bug

Using this extension v0.5.6 just shows "Resolving Vitest..." in the "Testing" tab of VS Code forever. We are using yarn with the pnp structure.

I tried debugging it (using latest master dad5884, sorry) and finally traced it back to https://github.com/vitest-dev/vscode/blob/main/src/api.ts#L276

I am not sure how this works but somehow the case is not handled where node does something (and exits?) but not starting any messaging. Capturing the stderr reveals the following:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at new NodeError (node:internal/errors:405:5)
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:131:11)
    at defaultLoad (node:internal/modules/esm/load:82:3)
    at nextLoad (node:internal/modules/esm/loader:163:28)
    at ESMLoader.load (node:internal/modules/esm/loader:603:26)
    at ESMLoader.moduleProvider (node:internal/modules/esm/loader:457:22)
    at new ModuleJob (node:internal/modules/esm/module_job:64:26)
    at #createModuleJob (node:internal/modules/esm/loader:480:17)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:434:34)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'

The "options" to the fork function was:

{
  "execPath":"",
  "execArgv": [
    "--require",
    "c:\\Users\\redacted\\repo\\.pnp.cjs",
    "--experimental-loader",
    "c:\\Users\\redacted\\repo\\.pnp.loader.mjs"
  ],
  "env": {
    "ELECTRON_RUN_AS_NODE":"1",
    "ELECTRON_USE_V8_CONFIGURED_PARTITION_POOL":true
  },
  "stdio":"overlapped",
  "cwd": "C:/Users/redacted/repo"
}

Back where this comes from should be

const pnpPath = require.resolve('./.pnp.cjs', {
paths: [folder.uri.fsPath],
})

There, pnpPath is c:\Users\redacted\repo\.pnp.cjs and folder.uri.fsPath is c:\Users\redacted\repo.

Honestly, I am not sure, how this works on non-Windows platforms. I would assume that the path is also absolute but then again it complains that it is not file://?

Thank you in advance!

(Unrelated note: The "Contributing" link for the issue template is broken.)

Reproduction

Any yarn pnp project on windows, I assume.

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i7-1370P
    Memory: 32.30 GB / 63.66 GB
  Binaries:
    Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.1.1 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.12.1 - C:\Program Files\nodejs\pnpm.CMD
  IDEs:
    VSCode: 1.87.2 - C:\Program Files\Microsoft VS Code\bin\code.CMD
  Browsers:
    Edge: Chromium (122.0.2365.92)
    Internet Explorer: 11.0.22621.1

Used Package Manager

yarn

Validations

@sheremet-va
Copy link
Member

Yarn PnP is not supported yet.

@sheremet-va
Copy link
Member

Also, please provide a minimal Yarn PnP project.

Copy link

Hello @Nithanim-Work. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 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

2 participants