I/O error cloudflare

So this is because you're using the global scope (i.e, you're putting the request from one request in a global variable and then accessing it from a different request)
9 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Isaac McFadyen
Isaac McFadyenOP2y ago
Oh, is this SvelteKit?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Isaac McFadyen
Isaac McFadyenOP2y ago
Alright, so what you need to do is move the new PocketBase into the GET() handler. Something like this:
let pocketbase: PocketBase;
export async function GET() {
if(pocketbase == null) {
pocketbase = new PocketBase();
}
}
let pocketbase: PocketBase;
export async function GET() {
if(pocketbase == null) {
pocketbase = new PocketBase();
}
}
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Isaac McFadyen
Isaac McFadyenOP2y ago
It should solve it, yeah. Depending on how expensive the new PocketBase() is though, you might want to do the above ^
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Isaac McFadyen
Isaac McFadyenOP2y ago
No, as long as you're not using the Unbound billing model.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server