Skip to content

Conversation

@ElijahJunaid
Copy link
Contributor

@ElijahJunaid ElijahJunaid commented Nov 12, 2025

#7747 - Replace wait-port dependency with custom implementation

  • Add retry logic with ECONNRESET error handling
  • Add HTTP agent with ECONNRESET handling in proxy
  • Enable framework host detection for Node 24+
  • Update tests to use new wait-port API

Fixes Node.js 24.x dev server startup failures

- Replace wait-port dependency with custom implementation
- Add retry logic with ECONNRESET error handling
- Add HTTP agent with ECONNRESET handling in proxy
- Enable framework host detection for Node 24+
- Update tests to use new wait-port API

Fixes Node.js 24.x dev server startup failures
@ElijahJunaid ElijahJunaid requested a review from a team as a code owner November 12, 2025 18:58
@ElijahJunaid
Copy link
Contributor Author

@VitaliyR did the changes and fixed the tests, they all passed on my end

settings.frameworkHost = ipVersion === 6 ? '::1' : '127.0.0.1'
const nodeVersion = process.versions.node
settings.detectFrameworkHost = options.skipWaitPort || semver.gte(nodeVersion, '24.0.0')
settings.detectFrameworkHost = options.skipWaitPort
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this change is not needed anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, it was updated with wait-port.ts

@ElijahJunaid
Copy link
Contributor Author

hopefully this one fixes the failed tests

@ElijahJunaid ElijahJunaid changed the title Fix: handle ECONNRESET errors in Node.js 24.x fix: handle ECONNRESET errors in Node.js 24.x Nov 13, 2025

socket.on('error', (error) => {
isResolved = true
cleanup()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup never called neither here nor in other places, since isResolved set to true everywhere, isn't it?
seems that cleanup is being redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are absolutely correct, its been removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests keep failing but it seems unrelated to my changes. my wait port is only to check if a port is open, but the env var isnt being injected, not something i touched

@ElijahJunaid
Copy link
Contributor Author

removed the proxy.ts handling added by an earlier version, caused unnecessary 500 errors, original problem still solved

@ElijahJunaid
Copy link
Contributor Author

@VitaliyR tests that are failing have nothing to do with my pull request, if you want i can investigate further and try to get a spotless test but itd have more files to be involved

host: 'localhost',
output: 'silent',
timeout: FRAMEWORK_PORT_TIMEOUT_MS,
...(settings.pollingStrategies?.includes('HTTP') && { protocol: 'http' }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried about this removal but I think it works out:

So... I think it works out. But we should remove pollingStrategies from @netlify/build-info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be done by a maintainer after the merge as its just info

@VitaliyR
Copy link
Contributor

@ElijahJunaid let me run the tests on my end, if they would pass I'm inclined to merge this PR

@ElijahJunaid
Copy link
Contributor Author

@VitaliyR youve gotten it to 3 failed tests (lint title does not count)

@ElijahJunaid
Copy link
Contributor Author

ElijahJunaid commented Nov 14, 2025

@VitaliyR i readded the prior retry count from the old wait-port to see if that fixes the last 3 tests as they seemed to timeout and i wondered if giving them more time would fix it - if the tests dont pass now, idk what im doing wrong

@ElijahJunaid ElijahJunaid requested a review from serhalp November 16, 2025 00:15
@ElijahJunaid
Copy link
Contributor Author

i need somebody to approve the checks to run! @VitaliyR @serhalp

@ElijahJunaid
Copy link
Contributor Author

@VitaliyR you need to do ur magic work again so we can see whats left in actual problems if any. currently i dont see any problems relating to this pull request, but it may be obstructed because of all of the unrelated errors (github problem)

@VitaliyR VitaliyR merged commit 03de2a0 into netlify:main Nov 18, 2025
181 of 201 checks passed
@VitaliyR
Copy link
Contributor

@ElijahJunaid thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants