Web Developer
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 :)