Skip to content
Back

[SOLVED] CORs problem even on localhost

  • 0
  • Resolved
  • 4
  • Cloud
David
9 Dec, 2025, 14:46

My frontend is screaming even it's the frontend is localhost.

I have tried to put * in hostname but still not fixed. Both in development and production.

What could be leading to this?

TL;DR
Solution: The CORS problem was resolved by treating value as an array in the code. Summary: The user faced a CORs problem even on localhost, which was resolved by making a specific change to the code. They shared information about using AI to generate the code and whether AI installed the Appwrite SDK package. Ultimately, the issue was resolved by adjusting the code to treat value as an array.
9 Dec, 2025, 15:32

Have you added your localhost address on Platforms in your console?

1
9 Dec, 2025, 15:59

Localhost should be added as a platform by default, but you can try specifically adding it

9 Dec, 2025, 22:10

I even tried adding there * for wildcard. I am now trying to see if project id is sent in the header requests.

10 Dec, 2025, 00:28

Thanks to <@462046107556511744> he pointed out something interesting about query formats. And I was able to resolve the issue.

1
10 Dec, 2025, 07:05

Glad your issue is resolved now! Please mark this post as solved by adding "[Solved]" in front of your post's title.

1
10 Dec, 2025, 08:41

CORs problem even on localhost [Solved]

10 Dec, 2025, 14:12

[SOLVED] CORs problem even on localhost

10 Dec, 2025, 19:04

do you know how/why this code was like this?

12 Dec, 2025, 12:37

First of all I used AI to generate much of the code. Could it be prompting or the AI not prioritising the latest documentation?

12 Dec, 2025, 16:16

Probably the latter

12 Dec, 2025, 16:20
  1. Did AI install the Appwrite SDK package too?
  2. Can you share what the code was?
  3. Are you using the Appwrite docs MCP server?
  4. How are you giving AI context about Appwrite?
13 Dec, 2025, 09:17
  1. Yes AI installed the SDK
  2. The code
TypeScript
  const result = await     databases.listDocuments(DATABASE_ID,COLLECTIONS.SUBSCRIPTIONS, [Query.equal("user_id", user.$id)]); //Notice value isn't an array
  if (result.documents.length > 0) {
    navigate({ to: "/dashboard" });
  }
} catch (e) {
  console.log("No subscription found");
}```

3. No, I didn't start with the Appwrite docs MCP server.
4. Oh yes, but it seems Claude usually has old knowledge about Appwrite.
18 Dec, 2025, 18:44

Weird...did you have different Appwrite SDKs installed?

19 Dec, 2025, 07:21

All I changed was treating value as an array and things started working.

SUBSCRIPTIONS, [Query.equal("user_id", [user.$id])]);

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more