
Hi, I'm developing a Chrome Extension using Svelte and Appwrite. However, when I try to execute a cloud Function, I always get the following error: AppwriteException: XMLHttpRequest is not defined
This is my code try { // Verify tabs is not empty if (!tabs || tabs.length === 0) { throw new Error("Tabs is empty"); }
// Verify tabs is not empty
if (tabs.length > 100) {
throw new Error("Tabs is too long");
}
const execution = await this.functions.createExecution(
'FUNCTION-ID',
JSON.stringify({ tabs }),
true,
'/',
'POST',
{ 'Access-Control-Allow-Origin': '*' }
)
console.log(execution);
return execution;
} catch (error: any) {
console.error("Error creating execution", error);
throw error;
}
I've read that Chrome Extensions only support Fetch, does the Appwrite SDK still use XHR? Any Ideas why this might be happening? Thanks :)

It uses cross fetch to work server-side and client side: https://github.com/appwrite/sdk-for-web/blob/ca8cb1d9f2c0393ec99c7d5cb50f3be543987918/src/client.ts#L2

Thank you so much, that seemed to be the Issue. I was able to solve it by overriding the cross-fetch version to 4.0, but that brings it's own challenges. So I think for now I'm just gonna use normal fetch instead of the SDK.

[CLOSED] AppwriteException: XMLHttpRequest is not defined
Recommended threads
- Web Console Columns Don't Save.
Minor issue - column flags in the console don't save. I tick some on or off, refresh the page or click on another page in the console, and it reverts back to ...
- Google auth
Hi, Guys can you hel me verifing a problem with the database, im creating a auth with google but when i created my user with google auth, no appear my user in ...
- Appwrite New York is 500 Internal Error
