undici icon indicating copy to clipboard operation
undici copied to clipboard

fix: avoid setup global dispatcher in advance

Open himself65 opened this issue 5 months ago • 4 comments

This relates to...

Rationale

Changes

lazy setup dispatcher so that lazyLoadUndici in node.js core module won't affect the globalThis

Features

Bug Fixes

Fixes: https://github.com/nodejs/node/issues/59012

Breaking Changes and Deprecations

Status

  • [x] I have read and agreed to the Developer's Certificate of Origin
  • [x] Tested
  • [ ] Benchmarked (optional)
  • [ ] Documented
  • [ ] Review ready
  • [ ] In review
  • [ ] Merge ready

himself65 avatar Jul 22 '25 09:07 himself65

CI doesn't seem happy

mcollina avatar Jul 30 '25 20:07 mcollina

Yeah I see, trying to figure out

himself65 avatar Jul 30 '25 21:07 himself65

@mcollina updated the code

himself65 avatar Aug 09 '25 01:08 himself65

Would it make more sense for undici to always overwrite the global dispatcher (if it's not from undici already)? Importing node:http might not cause issues anymore, but you'd still have these issues the second you used any of the undici-provided globals, right?

KhafraDev avatar Aug 15 '25 15:08 KhafraDev