vscode-site 0.2.5 doesn't work with Vite 5.0
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.
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.
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
there was no updates since 2021. maybe antony will fix it in the future or never?
I encountered the same issue.
I solved this issue by setting the Dev Command to start vite with a specific host:
npm run dev -- --host=127.0.0.1