Closed
Description
🐛 The bug
During test execution, while all tests are passing successfully, the process is generating a continuous cascade of ECONNREFUSED
errors attempting to connect to 0.0.0.0:443
. These errors appear to be unhandled 'error' events that don't affect test results but pollute the console output significantly. Began to surface when @nuxt/scripts v0.9.5
was introduced into the codebase.
Error: connect ECONNREFUSED 0.0.0.0:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1634:16)
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '0.0.0.0',
port: 443
🛠️ To reproduce
https://stackblitz.com/edit/nuxt-starter-pkwfkx
🌈 Expected behavior
Test execution should complete cleanly without Error: connect ECONNREFUSED
warnings.
ℹ️ Additional context
Using:
"@nuxt/test-utils": "^3.14.3",
"@testing-library/vue": "^8.1.0",
"@vitest/coverage-v8": "2.1.3",
"@vue/test-utils": "^2.4.6",
"nuxt": "latest",
"vitest": "^2.1.3"
- Coverage is enabled with v8
- All tests are passing despite the errors
- The errors seem to be related to attempted HTTPS connections to localhost (0.0.0.0:443)
- The issue appears to be an underlying network connection attempt that isn't properly handled, rather than a test failure