@whatwg-node/server
0.13.1 · 22 Oct 2026MIT1.9M / weekRepositoryHomepagenpmAtom feed
165 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.13.x · latest line
0.13.1
22 Oct 2026#3672
978ebedThanks @renovate! - Drain unread request bodies correctly when the adapter uses the platform (native undici)Requeston Node.js HTTPS.discardUnreadNodeRequestBodypreviously only calledIncomingMessage#resume(). That is enough for the@whatwg-node/node-fetchponyfill and for plainnode:http, but native undici keeps an unusedIncomingMessagebody paused. Onnode:httpsthe TLS upload then stalls mid-response:readableFlowingstays false, buffered unread bytes remain, and keep-alive / early-response paths hang or fail Node 26 unit coverage (discard-unread-request-body).For
fetchAPI.Request === globalThis.Requeston HTTPS (socket.encrypted),normalizeNodeRequestwraps the socket stream in a platformReadableStream(viafetchAPI.ReadableStream). Listeners attach on first pull; discard runs a sync drain helper (detach +IncomingMessage#resume) instead ofbody.cancel(), so unread TLS bytes drain without destroying keep-alive and without a runtimenode:stream/PassThroughimport or a floating cancel promise. Plain HTTP and ponyfill paths are unchanged (IncomingMessage+resume()only). Paths that reuserequest.bodyas the response body still skip discard via the existing identity checks.#3717
02e1834Thanks @ardatan! - Pick the native Fetch API forRequestsubclasses and proxies of them, such as Next.jsNextRequest.Constructor identity treated those requests as the ponyfill, so
useLimitRequestBodySizepiped a native body throughPonyfillTransformStreamand Node threwThe "transform.readable" property must be an instance of ReadableStream.
0.13.0
21 Sep 2026#3617
f78c03bThanks @ardatan! - Stop exportingcryptofrom@whatwg-node/fetch(and fromcreateFetch/FetchAPI). UseglobalThis.cryptoinstead; it is available on all supported runtimes (Node.js >=22.15).
Minor Changes
#3617
f78c03bThanks @ardatan! - Stop exportingcryptofrom@whatwg-node/fetch(and fromcreateFetch/FetchAPI). UseglobalThis.cryptoinstead; it is available on all supported runtimes (Node.js >=22.15).
- 0.12.x
0.12.0
21 Sep 20260.x packages: minor bump (breaking changes are allowed in minors while major is 0).
1.x packages (
@whatwg-node/promise-helpers,@whatwg-node/server-plugin-cookies): major bump, since dropping supported Node versions is a breaking engines change for SemVer>=1.0.0consumers.
Minor Changes
#3561
52a5bf6Thanks @ardatan! - Drop support for Node.js 18 and 20. The minimum supported Node.js version is now 22.15.
Why
Node.js 18 and 20 are end-of-life and no longer receive security updates. Keeping them in our support matrix forced version-specific workarounds and slowed adoption of newer Node TLS APIs.
The floor is set to 22.15 (not just 22.0) so we can rely on
tls.getCACertificates()(Node.js 22.15 / 23.10) and always-onzlibzstd helpers (createZstdCompress/createZstdDecompress, Node.js 22.15 / 23.8). That matches the oldest currently supported LTS line (22 Maintenance) while dropping only EOL majors.SemVer
0.x packages: minor bump (breaking changes are allowed in minors while major is 0).
1.x packages (
@whatwg-node/promise-helpers,@whatwg-node/server-plugin-cookies): major bump, since dropping supported Node versions is a breaking engines change for SemVer>=1.0.0consumers.
What changed
engines.node: all published packages now declare>=22.15.0(including@whatwg-node/promise-helpers, which was still on>=16).@whatwg-node/events: removed. NativeCustomEvent/Event/EventTargetare available on Node.js 22+, so the ponyfill is no longer maintained; use the platform globals.@whatwg-node/fetch: dropped therequire("crypto").webcryptofallback;cryptois alwaysglobalThis.cryptoon supported runtimes.@whatwg-node/server: removed the Node 18setHeadersworkaround (isNode1x);ServerResponse#setHeadersis used whenever it exists.@whatwg-node/node-fetch: Runtime guards forzlib.createZstdCompress/createZstdDecompressare removed;zstdis always included inAccept-Encoding.CI / e2e: unit matrix is
[22, 24, 26]; AWS Lambda runtime and Azure Function target moved from Node 20 to Node 22.
If you are still on Node 18 or 20, upgrade to Node.js 22.15+ (or 24 / 26) before installing this release.
#1505
36ef02bThanks @EmrysMyrddin! - Breaking Change: Remove deprecatedhandleNodeRequestin favor ofhandleNodeRequestAndResponse.adapter.handleNodeRequest(nodeRequest, ...ctx)is gone. PreferhandleNodeRequestAndResponse, which also receives the Node response so request normalization (abort wiring, etc.) can use it.Before:
const response = await adapter.handleNodeRequest(req, { userId: "1" });After:
const response = await adapter.handleNodeRequestAndResponse(req, res, { userId: "1", });Notes:
Pass the real
ServerResponse/Http2ServerResponse(or a container with{ raw: res }) as the second argument.Like before, this returns a WHATWG
Responseand does not write it tores. Useadapter(req, res),adapter.requestListener, oradapter.handle(req, res)when you want the adapter to send the response.
#3610
72dad02Thanks @ardatan! - AdduseLimitRequestBodySizeto reject oversized request bodies early viaContent-Length, and while streaming with a byte-countingTransformStream(so a short or missingContent-Lengthcannot bypass the limit).Optional
responseFromErrorcustomizes the early-rejectResponse(e.g. GraphQL error JSON in Yoga).If you also use
useContentEncoding, put it beforeuseLimitRequestBodySizein thepluginsarray so the limit applies to decoded body bytes.
Patch Changes
#3568
205d949Thanks @ardatan! - OmitAccess-Control-Allow-Originwhen the requestOriginis not in the allowlist, instead of sending the stringnull.Returning
Access-Control-Allow-Origin: nullis discouraged (MDN / W3C CORS for developers): the browser should simply not see an ACAO header and enforce the Same-Origin Policy.Browser coverage for this CORS behavior and for
@whatwg-node/server-plugin-cookiesis covered by Puppeteer tests (npm run test:browser).#3611
ebb2ab6Thanks @ardatan! - Discard unread Node/uWS request bodies when responding (e.g. earlyendResponse), so keep-alive connections are not stalled and large rejected uploads are not buffered for the lifetime of the response.#3012
3e55abcThanks @gmaclennan! - Destroy the Node response when the response body stream errors or is aborted, and propagateReadable.destroy(err)in the node-fetch stream ponyfill so piped sockets close with RST / ECONNRESET instead of hanging.Also make ponyfill
ReadableStream.pipeTo()reject when the destination write fails (after aborting the writer), instead of resolving successfully.#3590
d3b2c17Thanks @ardatan! - Fix nativeRequesthandling in the server adapter and pass the active fetch implementation to the request handler and plugins.When a request originated from the runtime's native
Requestimplementation, the server adapter could still use the ponyfill/default Fetch API during later pipeline stages. That could lead to mismatchedRequest/Responseconstructors and inconsistent behavior across runtimes such as Node, Bun, and Deno. For example in Next.js, the incoming request object is the native Request while the returningResponseobject is ponyfilled which causes an error since Next.js expects it to be a nativeResponseobject. As a workaround, you had to providefetchAPI: { Response }on your own. With this patch, this workaround is no longer needed.Native
Requestinstances are now detected correctly and routed through the matching runtime fetch API.The request pipeline keeps using the correct
Request,Response, and stream constructors for the active runtime.useErrorHandling()now passes the resolvedfetchAPIinto custom error handlers so they can construct responses with the correct runtime primitives.Request handlers now take
fetchAPIas a third argument, so that you don't need to worry about which fetch implementation to take.
createServerAdapter((request, context, fetchAPI) => fetchAPI.Response.json());
This keeps adapter behavior consistent and avoids subtle incompatibilities when handling native requests or custom fetch implementations.
It also avoids issues like this in GraphQL Yoga -> #4583 So that the
TransformStreamimplementation given byfetchAPIwill be compatible with the givenrequestinstance automatically.#3504
b4c83abThanks @ardatan! - Trim values when parsingAccept-Encoding/Content-Encodingheader lists.Native HTTPS clients (e.g. undici) send values like
br, gzip, deflate; without trimming, encodings after the first comma never matched and response compression was skipped.
- 0.11.x
0.11.0
2 Jun 2026Reading the note…
- 0.10.x
0.10.18
6 Jan 2026Reading the note…
0.10.17
10 Nov 2025Reading the note…
0.10.16
10 Nov 2025Reading the note…
0.10.15
4 Nov 2025Reading the note…
0.10.14
4 Nov 2025Reading the note…
0.10.13
9 Oct 2025Reading the note…
0.10.12
1 Aug 2025Reading the note…
0.10.11
28 Jul 2025Reading the note…
0.10.10
22 May 2025Reading the note…
0.10.9
20 May 2025Reading the note…
0.10.8
16 May 2025Reading the note…
0.10.7
16 May 2025Reading the note…
0.10.6
10 May 2025Reading the note…
0.10.5
14 Apr 2025Reading the note…
0.10.4
14 Apr 2025Reading the note…
0.10.3
25 Mar 2025Reading the note…
0.10.2
21 Mar 2025Reading the note…
0.10.1
6 Mar 2025Reading the note…
0.10.0
5 Mar 2025Reading the note…
- 0.9.x
0.9.71
3 Mar 2025Reading the note…
0.9.70
25 Feb 2025Reading the note…
0.9.69
24 Feb 2025Reading the note…
0.9.68
20 Feb 2025Reading the note…
0.9.67
14 Feb 2025Reading the note…
0.9.66
5 Feb 2025Reading the note…
0.9.65
24 Dec 2024Reading the note…
0.9.64
17 Dec 2024Reading the note…
0.9.63
13 Dec 2024Reading the note…
0.9.62
12 Dec 2024Reading the note…
0.9.61
10 Dec 2024Reading the note…
0.9.60
25 Nov 2024Reading the note…
0.9.59
25 Nov 2024Reading the note…
0.9.58
25 Nov 2024Reading the note…
0.9.57
25 Nov 2024Reading the note…
0.9.56
19 Nov 2024Reading the note…
0.9.55
14 Nov 2024Reading the note…
0.9.54
11 Nov 2024Reading the note…
0.9.53
8 Nov 2024Reading the note…
0.9.52
4 Nov 2024Reading the note…
0.9.51
4 Nov 2024Reading the note…
0.9.50
21 Oct 2024Reading the note…
0.9.49
21 Aug 2024Reading the note…
0.9.48
21 Aug 2024Reading the note…
0.9.47
14 Aug 2024Reading the note…
0.9.46
31 Jul 2024Reading the note…
0.9.45
26 Jul 2024Reading the note…