Back

Getting a CORS error while doing a react tutorial

  • 0
  • Web
rudra_2001
4 Dec, 2023, 09:14
TL;DR
The user is experiencing a CORS error while doing a react tutorial. The issue seems to be with the account.get() method in the user.jsx file. The user is advised to check if they are logged in and to provide the request for list documents. When using the IP address as the hostname, similar errors are encountered. It is recommended to use "localhost" as the hostname and to register 127.0.0.1 in the appwrite console for the project. The user is also asked for clarification on what they added for the web platform. The request headers for the list documents API call are requested. The user mentions bugs even
rudra_2001
4 Dec, 2023, 09:16

Hi steven, it seems that CORS error generate from ideas and user.jsx file. Also error code 401s

rudra_2001
4 Dec, 2023, 09:17

This is the permissions that I setup right now for my collections

rudra_2001
4 Dec, 2023, 10:06

@Drake this is the thread

rudra_2001
4 Dec, 2023, 10:08

Also how do you change the hostname of your web platform in your console ?

rudra_2001
4 Dec, 2023, 10:11

Ok so I have changed the hostname to my ip, but theres still some bugs

Drake
4 Dec, 2023, 10:11

Please share the request headers

Drake
4 Dec, 2023, 10:11

What?

rudra_2001
4 Dec, 2023, 10:12

These are the errors

Drake
4 Dec, 2023, 10:12

As I said, please share the request headers of the list documents API call

rudra_2001
4 Dec, 2023, 10:13

Do you mean these ?

Drake
4 Dec, 2023, 10:15

No

rudra_2001
4 Dec, 2023, 10:21

If not these can you let me know how to access the request headers ?

rudra_2001
4 Dec, 2023, 10:43

Are these the req headers ?

Drake
4 Dec, 2023, 11:13

what did you add for the web platform?

rudra_2001
4 Dec, 2023, 11:16

I'm really sorry but I don't understand your question

Drake
4 Dec, 2023, 11:17

In the appwrite console. You said you added a web platform, didn't you?

rudra_2001
4 Dec, 2023, 11:36

No, I just changed the name of the hostname and made it my IP address

rudra_2001
4 Dec, 2023, 11:36

127.0.0.1

Drake
4 Dec, 2023, 11:40

you should be using localhost. if you're using 127.0.0.1, you need to register that in the appwrite console for your project

rudra_2001
4 Dec, 2023, 19:07

If I use localhost as my host name I get these errors

rudra_2001
4 Dec, 2023, 19:08

And when I use my IP address as my hostname the errors are similar to the picture

Drake
4 Dec, 2023, 19:17

This is get account. Please show the request for list documents

Drake
4 Dec, 2023, 19:19

As I mention before, the get account is probably failing because you're not logged in

rudra_2001
4 Dec, 2023, 19:20

its these account requests from user.jsx file indicating an issue with account.get() method

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