PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.24k stars 174 forks source link

with cloudflare wrangler:Uncaught TypeError: globalThis.XMLHttpRequest is not a constructor #533

Open nathonNot opened 1 month ago

nathonNot commented 1 month ago

I'm using CF's Wrangler framework to develop an API, and when I plug in twitter-api-v2, yarn dev starts with an error message ` Uncaught TypeError: globalThis.XMLHttpRequest is not a constructor

at null. (index.js:11733:11) in checkTypeSupport at null. (index.js:11745:38) ` Seems to be due to a compatibility issue with node? I don't know if this is a bug or if it will be compatible with cf workers in the future

kiecooboi commented 3 weeks ago

I don't see this message in development but it fails when deploying to cloudflare due to the node.js API, I don't think this package is compatible with cloudflare.