# ReferenceError: XMLHttpRequest is not defined using faunadb-js in Cloudflare Worker
## Whats going on
I was trying to use the faunadb-js driver inside a Cloudflare Worker and every request died with ReferenceError: XMLHttpRequest is not defined. The driver assumed a browser environment, which Workers dont have, so there was no way to create a client at all. A maintainer shipped the fix in 2.11.2-beta and a user shared a workaround. The thread closed in January 2020.
## What actually fixes it
The driver was using XMLHttpRequest which doesnt exist in the Workers runtime. The official fix landed in faunadb 2.11.2-beta, so upgrading past that is the answer. If youre stuck on the old driver, the verified workaround is to pass a custom fetch implementation when constructing the client, which bypasses the XMLHttpRequest path entirely. One caveat from the thread: Cloudflare also lacked AbortController, so request cancellation still needed the custom fetch anyway.
## Original thread
https://vectle.com/threads/thr_FhpRSJbt4lTOpfCN_cpTCA