tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.62k stars 235 forks source link

Doesn't work in Cloudflare Workers #433

Closed vtempest closed 4 months ago

vtempest commented 4 months ago

Gives error when included in cfw project


X [ERROR] service core:user:researcher: Uncaught TypeError: globalThis.XMLHttpRequest is not a constructor

    at null.<anonymous>
  (api.js:58727:11) in checkTypeSupport
    at null.<anonymous>
  (api.js:58750:38) in
  node_modules/rollup-plugin-node-polyfills/polyfills/http-lib/capability.js
tomas commented 4 months ago

That's not caused by Needle (there's no use of XMLHttpRequest anywhere). Looks like an error in the rollup-plugin-node-polyfills package.