Fix telemetry delivery on Node.js 24 (#99842)
### Why?
Telemetry fails on Node.js 24 with this error before any HTTP request is
sent:
```text
TypeError: RequestInit: Expected signal ("AbortSignal {}") to be an instance of AbortSignal.
```
Native `fetch` checks that `RequestInit.signal` is an instance of Node's
native `AbortSignal`. The Edge Runtime ponyfill creates its own
`AbortSignal` class: the name is the same, but the constructor is
different, so the signal fails the instance check.
The telemetry transport retries once and suppresses the final error, so
the CLI can exit successfully without delivering events.
The controller was introduced when Next.js supported Node.js 14.6.
Next.js now requires Node.js 20.9 or later, where native
`AbortController` is available on all supported versions.
### How?
Use Node's native `AbortController` so its signal matches `fetch`,
preserving the existing timeout.
Verified real SDK HTTP delivery on Node.js 20.9, 22.6, and 24.1, and the
five-second cancellation deadline. The patched CLI received HTTP 204 for
all three upgrade lifecycle events; Snowflake persistence is not yet
verified. The full repository build and test suite were not run.
<!-- NEXT_JS_LLM -->
Showing
Please
register
or
sign in
to comment