Back

[SOLVED] CORS Error when accessing the documents in a collection

  • 0
  • Web
  • Cloud
D5
4 Jun, 2023, 12:10

Not sure too why you're obfuscating or similar your projectID (It's public)

TL;DR
Title: [SOLVED] CORS Error when accessing documents in a collection Solution: The issue was caused by adding 'localhost' as a custom domain instead of adding it as a web platform in the project settings. The user was advised to add a web platform to the project and try again. The problem was resolved by following this step.
Subramanya11
4 Jun, 2023, 12:21

Its not null

Subramanya11
4 Jun, 2023, 12:22
D5
4 Jun, 2023, 12:30

Could you try to put the project ID directly in the field (like a string)?

safwan
4 Jun, 2023, 12:37

the error would have stated it, but just to be sure, have you added a WEB platform to your project?

D5
4 Jun, 2023, 12:42

Just noticed that's the problem. @Subramanya11 You should add web platform

D5
4 Jun, 2023, 12:43

I've thought the second screenshot was adding a domain in the web platform the web platform. It seems like it's adding localhost as a custom domain instead πŸ˜…

safwan
4 Jun, 2023, 12:47

Just realized that the localhost is being added to the platform. I checked on my end πŸ˜…

Subramanya11
4 Jun, 2023, 12:48

yep

safwan
4 Jun, 2023, 12:49

Yeah that was dumb question on my part πŸ˜… I'm trying to think what could be going wrong.

Subramanya11
4 Jun, 2023, 12:49

ok np

D5
4 Jun, 2023, 12:50

What's the appwrite version you're using?

D5
4 Jun, 2023, 12:50

Cloud?

Subramanya11
4 Jun, 2023, 12:50

Yes cloud version

Subramanya11
4 Jun, 2023, 12:50

Appwrite version 11.0.0

otik
4 Jun, 2023, 12:51

In URL in your browser, do you have 127.0.0.1 or localhost? With 127.0.0.1 it wont work

Subramanya11
4 Jun, 2023, 12:52

localhost 3000

safwan
4 Jun, 2023, 12:53

Is this the appwrite sdk version?

safwan
4 Jun, 2023, 12:53

Can you use v10.1.0 instead and try?

Subramanya11
4 Jun, 2023, 12:55

Yep I did npm install appwrite

Subramanya11
4 Jun, 2023, 12:55

Sure

safwan
4 Jun, 2023, 12:55

Let me know if ti works

Subramanya11
4 Jun, 2023, 16:13

I created a new project in appwrite cloud and followed the same steps again. Everything is working perfectly

D5
4 Jun, 2023, 16:16

Weird, probably any ID was not correct, or there was a bug

D5
4 Jun, 2023, 16:16

[SOLVED] CORS Error when accessing the documents in a collection

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