// https://github.com/nodejs/undici/issues/2750#issuecomment-2707472553
// undici global symbol are lazy loaded, so we need to trigger it first
try { fetch('data:;base64,') } catch (e) { }
// Get the global agent
const unidiciGlobalDispatcherSymbol = Symbol.for('undici.globalDispatcher.1');
const agent = globalThis[unidiciGlobalDispatcherSymbol]
// get the agent internal options
const symbols = Object.getOwnPropertySymbols(agent)
const [ options ] = symbols.filter(predicate => predicate.toString().includes('options'))
const agentOptions = agent[options]
// enable h2
agentOptions.allowH2 = true
And then make your sweet loving h2 request without any trouble
fetch(...)