-
Notifications
You must be signed in to change notification settings - Fork 11
XMLHttpRequest is not defined - Does not work on Cloudflare Worker #72
Comments
I tested removing |
As I commented just now in another issue, those two packages are designed specifically for Node.js and browser environments, where For the likes of Cloudflare Workers which operate in their own custom sandbox, we could probably do with a separate package that's specifically tailed for that environment. In the meantime, the workaround I'd recommend is copying this code to your project from If you find you need to customize further, another approach is to extend |
Thanks this sound like a solid workarounds for now. |
An even more easy fix when using Webpack:
Update: This is not working somehow. If someone knows why, please comment :) |
I want to use timber inside of a serverless environment "Cloudflare Worker". There
XMLHttpRequest
is not defined, instead there isfetch()
.I tried both
@timberio/node
and@timberio/node
but both importcross-fetch
browser-ponyfill.js
which throws this error.Is there a way to use timberio without cross-fetch? Or at least without any polyfill?
Why is browser-ponyfill imported even tho i used
@timberio/node
?The text was updated successfully, but these errors were encountered: