Skip to content
Back

🚨 CORS Issues with Web Platform Configuration - Need Help

  • 0
  • Databases
  • Web
simsili
25 Jul, 2025, 15:14

Hi! i am new to react and i am making a movie web app as a first project (learning while doing so i barely know stuff now) I've been struggling with CORS errors for hours and tried everything. Here's what's happening:

Timeline of Issues:

  1. Initial Problem (Anonymous Sessions): Access to fetch at 'https://cloud.appwrite.io/v1/account/sessions/anonymous' from origin 'http://localhost:5173' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

i tried everything: Added Web platform with hostname: localhost as i cant include port number (localhost:5173) Tried also the * in host name but nothing worked All platforms show as enabled (green toggle) all the ids are correct and matching Still getting CORS errors

so i switched to email/password authentication: but same thing Access to fetch at 'https://cloud.appwrite.io/v1/account' from origin 'http://localhost:5173' has been blocked by CORS policy

been trying for hours so if anyone can help it will be so appreciated, thanks for listening.

TL;DR
Developers faced CORS issues with the Web platform configuration. Resolved by switching the endpoint to 'nyc.cloud.appwrite.io'. Further issues due to rate limit can be resolved by waiting or using dev keys. Double-check project IDs, look for CORS errors in the network tab, and ensure the correct request URLs. For unexpected security issues, sign out and back into the Appwrite Console. If CORS issues persist, verify that the project ID is set correctly.
Meldiron
25 Jul, 2025, 15:14

Heyy 👋 Localhost is allowed by default, even without web platform. Most commonly, the issue is wrong project ID. Can you check that was set correctly?

simsili
25 Jul, 2025, 15:14

i already did and its correct

Meldiron
25 Jul, 2025, 15:15

Can you please open network tab in your browser, locate the request, and copy it as CURL? Seeing that CURL command will help us greatly in identifying the issue

simsili
25 Jul, 2025, 15:16

sorry bro i didnt understand i dont know much can you explain how to do that?

simsili
25 Jul, 2025, 15:17

what do you mean by network tab

Meldiron
25 Jul, 2025, 15:18

No worries at all man, here is quick example how I took it from one of my Appwrite apps:

Meldiron
25 Jul, 2025, 15:18

If you get both requests (one for OPTIONS, one for POST), both is useful. But sicne it's CORS, I would guess only one such request will be there

simsili
25 Jul, 2025, 15:20

there is one for local host, and multiple ones called account that failed because now the code is after i changed it to email/pass verification which do i send

Meldiron
25 Jul, 2025, 15:22

We are interested in one where CORS fail, based on your message above, that should be /v1/account/sessions/anonymous

Meldiron
25 Jul, 2025, 15:23

Thanks for sharing, you can delete the message now

Meldiron
25 Jul, 2025, 15:24

Unexpected thing happened here, curl command included your console session. I recommend you to sign out, and sign back in to Appwrite Console, to be extra safe https://cloud.appwrite.io/

simsili
25 Jul, 2025, 15:24

ok

simsili
25 Jul, 2025, 15:25

did

Meldiron
25 Jul, 2025, 15:27

Thanks 🙏

Hmm, this request seems totally fine 🤔 Also looking at it, it's different path, /v1/account. it might be that some request work, but some dont (regarding CORS).

That might be because you do new Client() in multiple places in your code - and in some places you set project ID properly, and in some the ID is missing.

Let's please check your code if that might be the case. If that's not it, we will need to find request that is causing the CORS error - we will need URL in cors error to match URL in the curl request you copy

simsili
25 Jul, 2025, 15:28

do i copy paste or send a zip file ?

simsili
25 Jul, 2025, 15:29

if copy paste which ones you need

Meldiron
25 Jul, 2025, 15:29

If you are fine with that, you can zip whole thing for me, and I can take a quick look. If you have any kind of secrets, like api keys in the code, you can send it to me over Discord PMs as well

simsili
25 Jul, 2025, 15:30

ok i will send as dm because also i wrote the email/pass

Meldiron
25 Jul, 2025, 16:00

For refference, problem was in endpoint, cloud.appwrite.io was used, but project was in New York, so we had to switch to nyc.cloud.appwrite.io in setEndpoint, resolving the issue.

Simsili is facing issues still, but likely just rate limit, which can be resolved by waiting 1 hour, or using dev keys https://appwrite.io/blog/post/announcing-dev-keys

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