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 vscode plugin is listening on the port which is needed by vite #6714

Closed
4 tasks done
fourdim opened this issue Oct 12, 2024 · 7 comments · Fixed by #6717
Closed
4 tasks done

Vitest vscode plugin is listening on the port which is needed by vite #6714

fourdim opened this issue Oct 12, 2024 · 7 comments · Fixed by #6717

Comments

@fourdim
Copy link

fourdim commented Oct 12, 2024

Describe the bug

image

Possibly related to #443.

Reproduction

  1. Download the repo.
git clone https://github.com/toeverything/blocksuite
  1. Install Vitest VSCode plugin.

  2. Install dependencies.

yarn
  1. Development mode.
yarn dev

Here Vite is not binding to the default 5173 but 5175.

image

Output

[INFO 4:53:41 PM] [v1.6.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 4:53:41 PM] [API] Running Vitest v2.1.2 (blocksuite/vitest.workspace.js) with Node.js@v20.17.0: /home/fourdim/.config/nvm/versions/node/v20.17.0/bin/node 
[INFO 4:53:42 PM] [Worker] �[33mThe CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.�[39m
[INFO 4:53:42 PM] [Worker] Forced re-optimization of dependencies
[INFO 4:53:42 PM] [Worker] Port 5173 is in use, trying another one...
[INFO 4:53:42 PM] [API] Vitest v2.1.2 (blocksuite/vitest.workspace.js) child process 78366 created
[INFO 4:53:42 PM] [VSCODE] Watching blocksuite with pattern **/*

Version

v1.6.0

Validations

@sheremet-va
Copy link
Member

Does this happen if you just run vitest in the root?

@fourdim
Copy link
Author

fourdim commented Oct 15, 2024

If I uninstall the extension and run the vitest in the root:
image
I think it's expected behavior as we need to launch two instances:

  • presets: bind 5173
  • block-std: first try to bind 5173, then 5174

@hi-ogawa
Copy link
Contributor

Browser runner taking 5173 wasn't intended and was fixed in #6700 Can you try the latest pkg-pr-new from https://github.com/vitest-dev/vitest/runs/31509661255?

@fourdim
Copy link
Author

fourdim commented Oct 15, 2024

Browser runner taking 5173 wasn't intended and was fixed in vitest-dev/vitest#6700 Can you try the latest pkg-pr-new from https://github.com/vitest-dev/vitest/runs/31509661255?

Still, this issue persists.

image
image

@hi-ogawa
Copy link
Contributor

Did you update @vitest/browser?

@fourdim
Copy link
Author

fourdim commented Oct 15, 2024

Did you update @vitest/browser?

Issue persists even if I update @vitest/browser.

@sheremet-va
Copy link
Member

sheremet-va commented Oct 15, 2024

Browser runner taking 5173 wasn't intended and was fixed in vitest-dev/vitest#6700 Can you try the latest pkg-pr-new from vitest-dev/vitest/runs/31509661255?

I can actually confirm that pkg.pr.new from https://github.com/vitest-dev/vitest/actions/runs/11343255694/job/31545435431 fixes the issue in the reproduction. It now uses 63315 by default, but the next one still tries to use 63315 - I wonder if we can track that on our side.

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
Forced re-optimization of dependencies
Port 63315 is in use, trying another one...

 DEV  v2.1.3 /Reproductions/blocksuite
      [@blocksuite/presets] Browser runner started by playwright at http://localhost:63315/
      [@blocksuite/block-std] Browser runner started by playwright at http://localhost:63316/

@sheremet-va sheremet-va transferred this issue from vitest-dev/vscode Oct 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants