jeffbski / jeffbski/wait-on

wait-on perpetually returns ECONNREFUSED when using localhost, but works fine using 127.0.0.1

Open
#109 13 comments 11 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2k
Forks
87
PR merge metrics
No merged PRs in 30d

Description

I had been using the [start-server-and-test](https://github.com/bahmutov/start-server-and-test) module for kicking off my server, and then starting my tests, however I couldn't get it to work using http. I ended up creating a minimal repro [here](https://github.com/thepuzzlemaster/playwright-defect-repro/tree/wait-on-defect) (note the wait-on-defect branch).

I realized that it *does* however, work fine if I switch my `localhost` to `127.0.0.1`. I can curl the localhost fine in a terminal window and it returns the html string. I'm using next js as my server, which does run via webpack, so using http-get, but to no avail.

repro steps:
- pull down minimal repro and checkout `wait-on-defect` branch
- `yarn install`
- `yarn test:integration`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with wait-on's HTTP resource handling and reproduce the report using the linked minimal repro on its wait-on-defect branch. Run yarn install followed by yarn test:integration, then verify that the requested localhost resource succeeds as it does with 127.0.0.1.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, node.js
Domain
cli, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.