Skip to content

Conversation

@gregonarash
Copy link

This relates to...

#2990 (comment)
and likely more issues facing ETIMEDOUT errors related to network family selection ipv4/ipv6

Rationale

Doc update to help debug ETIMOUTED error

Changes

New Doc file added

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A

Status

N/A

 updating network family autoselection timeout to avoid ETIMEDOUT error
Co-authored-by: Mickaël Derriey <mderriey@gmail.com>

### Increasing timeout by updating Node options in package.json

On example of a NextJS project:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
On example of a NextJS project:
One example with a Next.js project:


The default timeout depends on local Node version, on Node 18.13.0 and above is 250 milliseconds.

### Increasing timeout by updating Node options directly
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### Increasing timeout by updating Node options directly
### Increasing timeout by updating `NODE_OPTIONS` directly


If you are experiencing `TypeError: fetch failed` and you are able to investigate the `cause: AggregateError` and see `code: 'ETIMEDOUT'` it can be very likely due to timeout network family autoselection. This tends to happen with DNS resolving domain to multiple ipv4 and ipv6 addresses.

The default timeout depends on local Node version, on Node 18.13.0 and above is 250 milliseconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The default timeout depends on local Node version, on Node 18.13.0 and above is 250 milliseconds.
The default timeout depends on local Node version, on Node.js 18.13.0 and above is 250 milliseconds.


`export NODE_OPTIONS="--network-family-autoselection-attempt-timeout=500"`

### Increasing timeout by updating Node options in package.json
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
### Increasing timeout by updating Node options in package.json
### Increasing timeout by updating `NODE_OPTIONS` in package.json

@cliffordkleinsr
Copy link

Any updates on this?

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.

fetch fail: cause: AggregateError [ETIMEDOUT]:

5 participants