Hi, I wanna use FaunaDB in Cloudflare Workers, but when I use Client or a standalone query without the Client from the official faunadb npm package I get this error:
TypeError: Cannot read property 'custom' of undefined
at Object.<anonymous> (worker.js:1:27123)
at n (worker.js:1:110)
at Object.<anonymous> (worker.js:1:5589)
at n (worker.js:1:110)
at Object.<anonymous> (worker.js:1:34737)
at n (worker.js:1:110)
at Object.<anonymous> (worker.js:6:10830)
at n (worker.js:1:110)
at Object.<anonymous> (worker.js:1:34594)
at n (worker.js:1:110) at line 0, col 27121
I just wanted to see the output of the query builder so I tried console.log(q.Query(q.Collection("users"))) but got the same error. My local FaunaDB instance is running alright. Tested with fauna dashboard.
I don’t have a Cloudflare account, currently, so I can’t attempt to replicate right now.
It’s hard to tell if the error is, indeed, coming from the Fauna JS driver, or something else in your worker code. Have you tried commenting out the Fauna bits to see if the error persists?