Skip to content

Conversation

@addaleax
Copy link
Contributor

@addaleax addaleax commented Aug 7, 2025

node-fetch currently does not return a body that is a web/standard ReadableStream, which is what openid-client expects. Since it only makes use of this in error cases, no additional cases are broken, but the error message is highly unhelpful in these cases.

Unfortunately, it is not trivial to resolve this without fully wrapping the node-fetch, so this provides a limited compatibility layer rather than a full-featured one. (Note – I'm opening the PR with this approach but I'd be up for changing this if somebody feels strongly that we should put in the effort to provide a full layer around Response. We can't "just" replace .body only because node-fetch's .text() and .json() methods expect it to be a Node.js stream.)

`node-fetch` currently does not return a body that is a web/standard
`ReadableStream`, which is what openid-client expects. Since it only
makes use of this in error cases, no additional cases are broken,
but the error message is highly unhelpful in these cases.

Unfortunately, it is not trivial to resolve this without fully wrapping
the `node-fetch`, so this provides a limited compatibility layer rather
than a full-featured one.
@github-actions github-actions bot added the fix label Aug 7, 2025
@addaleax addaleax merged commit 802564b into main Aug 8, 2025
19 checks passed
@addaleax addaleax deleted the 2443-dev branch August 8, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants