Back

[SOLVED] AppwriteException: Network request failed , CORS problem

  • 0
  • Databases
  • Web
Axentioi
3 Jun, 2023, 10:46

When creating 2 database resources, and then updating an existent many-to-many resource with that, it gives me No 'Access-Control-Allow-Origin' header is present on the requested resource. CORS error from the respective page, even if the page is added in the whitelist. But when I call the function again from the same page, it doesn't have any problem.

TL;DR
User is experiencing a CORS problem when making a network request in their Appwrite app. They are unsure of what to do and have checked their variables. Another user suggests adding the domain and checking if the document exists. The original user confirms that the domain is added and that the updateDocument function is failing. They mention that they are also running create functions on two different collections before running the update. Another user asks if the platform is added properly in the Appwrite dashboard and if they have run the migration command. The original user confirms that they have done both. Another user suggests upgrading to version 1.3.6 and running the migration
D5
3 Jun, 2023, 11:12

What's the appwrite version you're using?

Axentioi
3 Jun, 2023, 11:24

1.3.5

D5
3 Jun, 2023, 11:27

Did you have ran migration command after upgrading Appwrite?

Axentioi
3 Jun, 2023, 11:28

Will update to 1.3.6 in a few and come back, yes we ran migration command on 1.3.5

Axentioi
3 Jun, 2023, 11:31
Axentioi
3 Jun, 2023, 11:31

after updating to 1.3.6

Axentioi
3 Jun, 2023, 11:31

same issue on web skd for the first update from the page

D5
3 Jun, 2023, 11:32

Did you have ran migration comand?

Axentioi
3 Jun, 2023, 11:32

yes

D5
3 Jun, 2023, 11:32

Is the platform added properly into the appwrite dashboard?

Axentioi
3 Jun, 2023, 11:33

well before running the update I am also running create into two different collections, raffles and keys

Axentioi
3 Jun, 2023, 11:33

which is accepted

Axentioi
3 Jun, 2023, 11:33

only the updateDocument is failing from the page

Axentioi
3 Jun, 2023, 11:33

the flow is createKey => createRaffle => updateDocument(Server.databaseId!, Server.collections.queue!, previousQueueId, { gameTitle: selectedGame.label, updatedAt: new Date(Date.now()), raffles: previousRaffles.length > 0 ? [...previousRaffles, raffle] : [raffle] })

D5
3 Jun, 2023, 11:34

But did you added the domain?

Axentioi
3 Jun, 2023, 11:34

yes

D5
3 Jun, 2023, 11:39

Seems like you should ignore cors, the problem seems to be that the document doesnt exists (404 error)

D5
3 Jun, 2023, 11:40

So probably you're not using any correct ID or similar

Axentioi
3 Jun, 2023, 11:42

hmm, thank you I will go back at it and check

Axentioi
3 Jun, 2023, 11:48

You were right, my variable for updating the queueId was firstly undefined due to how my react behaved so that's why it didn't have it updated after querying first.

Axentioi
3 Jun, 2023, 11:49

Thanks, loving to use Appwrite

D5
3 Jun, 2023, 11:50

[SOLVED] AppwriteException: Network request failed , CORS problem

Nur
5 Sep, 2023, 00:24

I also faced the cors error but I check my varaibler are all set. what should I do now. I have next js app

Drake
5 Sep, 2023, 00:35

Create a new <#1072905050399191082> post with your details (full logs from the browser and creenshots of what you configured)

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