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

AggregateError ECONNREFUSED #7135

Open
6 tasks done
pfe-nazaries opened this issue Dec 26, 2024 · 4 comments
Open
6 tasks done

AggregateError ECONNREFUSED #7135

pfe-nazaries opened this issue Dec 26, 2024 · 4 comments

Comments

@pfe-nazaries
Copy link

pfe-nazaries commented Dec 26, 2024

Describe the bug

Hi guys,

i just updated my vitest packages (vitest, ui and coverage-v8) from 2.1.2 to 2.1.8.

After that i runned my test and even they pass a message (the following one) was introduced into the output

AggregateError:
at internalConnectMultiple (node:net:1118:18)
at afterConnectMultiple (node:net:1685:7) {
code: 'ECONNREFUSED',
[errors]: [
Error: connect ECONNREFUSED 127.0.0.1:3000
at createConnectionError (node:net:1648:14)
at afterConnectMultiple (node:net:1678:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 3000
},

I downgraded the version of the packages and incrementally 1 by 1 until i discovered that in 2.1.5 is the version where this exception start to happen

I think is has to do with this change

image

Reproduction

https://github.com/pfe-nazaries/vitest-repro

run pnpm i
run vitest

observe the log for the error

System Info

 System:
    OS: macOS 15.2
    CPU: (11) arm64 Apple M3 Pro
    Memory: 3.49 GB / 36.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 20.18.0 - ~/.nvm/versions/node/v20.18.0/bin/node
    npm: 10.8.2 - ~/.nvm/versions/node/v20.18.0/bin/npm
    pnpm: 9.13.2 - ~/.nvm/versions/node/v20.18.0/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    @vitejs/plugin-react-swc: ^3.5.0 => 3.7.2 
    vite: ^6.0.5 => 6.0.6 
    vitest: ^2.1.8 => 2.1.8 

Used Package Manager

pnpm

Validations

Copy link

Hello @pfe-nazaries. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

@pfe-nazaries
Copy link
Author

Hi, im trying to create a repro.

In the meanwhile i can confirm that happy-dom seems to be the problem. If i switch environment in vitest config from happy-dom to jsdom the message dissapears.

I still think that this matches the change in 2.1.5 that i think triggers the message

image

@pfe-nazaries
Copy link
Author

@hi-ogawa added reproduction repo

Look at vitest-setup.ts file for my explanation about the problem.

image

@pfe-nazaries
Copy link
Author

Also the problem happens when enviromment is happy-dom, not jsdom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants