
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
- MCP Server Tool Integration Issue with C...
I'm experiencing issues integrating the MCP server tool with Cursor IDE. The MCP server connection establishes successfully initially but fails after one minute...
- Latest console still using documents and...
Hello on my self hosted instance, i am using ``appwrite:1.7.4`` and ``console:6.0.13`` I create a new project and database but for some reason not using the n...
- 401 Unauthorized
Im new to appwrite got an issue , i implemented Oauth but in browser console it says (user role guests missing scopes account... )
