.../repro/node_modules/node-fetch/src/index.js:216
if (response_.statusCode !== 303 && request.body && options_.body instanceof Stream.Readable) {
^
TypeError: Cannot read properties of undefined (reading 'body')
at ClientRequest.<anonymous> (.../repro/node_modules/node-fetch/src/index.js:216:68)
at ClientRequest.emit (node:events:530:35)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:716:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
at Socket.socketOnData (node:_http_client:558:22)
at Socket.emit (node:events:530:35)
at addChunk (node:internal/streams/readable:561:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
at Readable.push (node:internal/streams/readable:392:5)
at TCP.onStreamRead (node:internal/stream_base_commons:189:23)
Node.js v22.14.0
Both linux and windows.
Node.js v22.14.0
Reproduction
minimal.mjs
package.json
{ "dependencies": { "express": "^5.1.0", "node-fetch": "^3.3.2" } }npm inode minimal.mjsExpected behavior
Program should not crash
Screenshots
N/A
Your Environment
Both linux and windows.
Node.js v22.14.0
Additional context
N/A