The undici based fetch (exposed as globalThis.fetch in Node 18 and up) doesn't work out of the box with global-agent which we use to proxy the requests through Jambox.
Thought about applying this in our application code but other apps probably want a similar fix as well.
There is some traction on an issue for the Node steering committee to standardize this which should make this code obsolete, but who knows when that will land, see: https://github.com/nodejs/node/issues/43187
The
undici
basedfetch
(exposed asglobalThis.fetch
in Node 18 and up) doesn't work out of the box withglobal-agent
which we use to proxy the requests through Jambox.There are some workarounds mentioned on this issue: https://github.com/gajus/global-agent/issues/52, particularly this one: https://github.com/gajus/global-agent/issues/52#issuecomment-1134525621 which seems like a good thing to consider doing inside Jambox to normalize the
fetch
handling/proxying.Thought about applying this in our application code but other apps probably want a similar fix as well.
There is some traction on an issue for the Node steering committee to standardize this which should make this code obsolete, but who knows when that will land, see: https://github.com/nodejs/node/issues/43187