Back

[SOLVED] CORS error in project after Adding Platform

  • 0
  • Web
Talha
3 Nov, 2023, 17:47

I have added web platform and gave host localhost,still i'm facing cors error

TL;DR
After adding a platform, the user encountered a CORS error in their project. They realized that the issue was caused by a project ID error in their environment variables. They restarted their server, hoping that it would fix the problem. Another user suggested checking if the `client.setProject()` function was being passed the correct value. The user shared their request headers and received advice to open the browser's dev tools, switch to the network tab, refresh the page, reproduce the problem, and share the request headers from the network logs. The user mentioned that they used the appwrite module from npm for acquiring appwrite services. They also added a web
Drake
3 Nov, 2023, 17:57

Would you please share the request headers for the request?

Talha
3 Nov, 2023, 18:08

I dont know i used appwrite module using npm to acquire appwrite services

Drake
3 Nov, 2023, 18:10

sure....now, you're getting errors in the browser. Please

  1. open the browser dev tools
  2. switch to the network tab
  3. refresh the page so your app restarts
  4. reproduce the problem
  5. look for the related network request in the network logs
  6. share the request headers
Talha
3 Nov, 2023, 18:13

Request URL: https://cloud.appwrite.io/v1/databases/65448ebfa00cbb4a70a3/collections/65448efc09563b33ed0f/documents?queries%5B0%5D=equal%28%22status%22%2C+%5B%22active%22%5D%29 Request Method: GET Status Code: 404 Not Found Referrer Policy: strict-origin-when-cross-origin

Talha
3 Nov, 2023, 18:13

these are my request headers

Drake
3 Nov, 2023, 18:15

please share a screenshot

Drake
3 Nov, 2023, 18:15

i don't think these are the full request headers. Is this the General section?

Drake
3 Nov, 2023, 18:16

X-Appwrite-Project: undefined

your project is undefined

Talha
3 Nov, 2023, 18:17

how to fix it

Drake
3 Nov, 2023, 18:21

make sure you're passing the right value to client.setProject()

Talha
3 Nov, 2023, 18:26

i found projectid error in my env variables now restarting my server hopefully workout

Talha
3 Nov, 2023, 18:26

Thanks a lot

Drake
8 Nov, 2023, 00:56

[SOLVED] CORS error in project after Adding Platform

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