node-twitter-api-v2 icon indicating copy to clipboard operation
node-twitter-api-v2 copied to clipboard

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

Open nathan77886 opened this issue 1 year ago • 1 comments

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

nathan77886 avatar May 30 '24 15:05 nathan77886

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.

kiecooboi avatar Jun 17 '24 09:06 kiecooboi

Indeed, it's a compatibility issue between cloudflare workers and node.

See https://developers.cloudflare.com/workers/runtime-apis/nodejs/http/

plhery avatar Sep 04 '25 22:09 plhery