antfu / vscode-vite

One step faster for Vite in VS Code ⚡️
https://marketplace.visualstudio.com/items?itemName=antfu.vite
448 stars 25 forks source link

vscode-site 0.2.5 doesn't work with Vite 5.0 #39

Open sun128764 opened 9 months ago

sun128764 commented 9 months ago

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

sun128764 commented 9 months ago

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

k0r37k1 commented 9 months ago

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

CassandraCat commented 7 months ago

I encountered the same issue.

samuelsuarezsanchez commented 6 months ago

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

npm run dev -- --host=127.0.0.1