vscode-vite icon indicating copy to clipboard operation
vscode-vite copied to clipboard

vscode-site 0.2.5 doesn't work with Vite 5.0

Open sun128764 opened this issue 2 years ago • 4 comments

Describe the bug

When use Vite 5.0 vue-ts template and vscode-site 0.2.5, it will try to close(Ctrl+C) after a while.

image

Reproduction

https://stackblitz.com/edit/vitejs-vite-stmbrn?file=index.html&terminal=dev

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 Intel(R) Core(TM) i5-10500 CPU @ 3.10GHz
    Memory: 5.34 GB / 15.75 GB
  Binaries:
    Node: 18.4.0 - C:\Program Files\nodejs\node.EXE
    npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (119.0.2151.72)
    Internet Explorer: 11.0.19041.1566

Used Package Manager

npm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

sun128764 avatar Nov 20 '23 03:11 sun128764

This problem occurs at https://github.com/antfu/vscode-vite/blob/main/src/utils.ts#L41C5-L41C5 Somehow, the 'http.request' can't access http://localhost:4000 and throw an "ECONNREFUSED:127.0.0.1 refused to connect" error

sun128764 avatar Nov 25 '23 18:11 sun128764

there was no updates since 2021. maybe antony will fix it in the future or never?

k0r37k1 avatar Dec 05 '23 21:12 k0r37k1

I encountered the same issue.

CassandraCat avatar Feb 13 '24 11:02 CassandraCat

I solved this issue by setting the Dev Command to start vite with a specific host:

npm run dev -- --host=127.0.0.1

samuelsuarezsanchez avatar Feb 24 '24 02:02 samuelsuarezsanchez