You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess the issue is when the library is bundled (e.g. by webpack), it causes code that's conditionally required only on certain Node versions to be included in the resulting code bundle, and there are instances of nullish coalesce assignmen t (??=) syntax in those parts (specifically lib/fetch/headers.js, lib/cookies/parse.js, and lib/websocket/receiver.js).
Without bundling those are only required on Node 16+ but when bundled, it causes parsing errors even though those features aren't used.
I've worked around it so far by configuring Babel to parse&transform this library. Perhaps at least a warning about using this library with bundlers in the docs would be helpful.
Activity
mcollina commentedon Mar 7, 2023
Could you tell us more about the compatibility issues you are facing? Our test suite (minus fetch, which is 16+) pass on node v12: https://github.com/nodejs/undici/actions/runs/4331585584.
vetruvet commentedon Mar 7, 2023
I guess the issue is when the library is bundled (e.g. by webpack), it causes code that's conditionally required only on certain Node versions to be included in the resulting code bundle, and there are instances of nullish coalesce assignmen t (
??=) syntax in those parts (specificallylib/fetch/headers.js,lib/cookies/parse.js, andlib/websocket/receiver.js).Without bundling those are only required on Node 16+ but when bundled, it causes parsing errors even though those features aren't used.
I've worked around it so far by configuring Babel to parse&transform this library. Perhaps at least a warning about using this library with bundlers in the docs would be helpful.
ronag commentedon Mar 7, 2023
We could also not use
??=... PR welcomeKhafraDev commentedon Mar 8, 2023
we've had regressions so I'd rather not accept a PR unless tests are included
[-]Request: bump minimum Node.js version in package.json[/-][+]bundling issues with webpack[/+]trivikr commentedon May 3, 2026
Closing as the issues raised in this were with node 12 in undici 4.x, and all undici versions <7.x have been end-of-life at the time of writing.