
I'm using appwrite in a client without SDK.
I'm trying to use data.updateDocument()
method but getting CORS error.
However GET
, POST
and other methods work well.
I'm not sure, but I think the problem is with the PATCH
method.
How can I solve this? ( i'm using NextJS14 ).

Did it work before?

@k_vasen No, it didn't work from the start

can you show code

please

What are the permissions on the collection and document?

@ZachHandley Here is the code

@Steven I have enabled all document permissions

But with postman, it is working

Postman typically ignores CORS

Does the collection have any relationship attributes?

@Steven yes, columnId is a relationship attr that related to columns

What are the permissions on that collection?

ah smart

@Steven I've enabled all permissions in all collections

And you're getting the same error still?

@Steven yes

Here I created route handler, this is a request from server with "node-appwrite" and it works fine.
But it gives CORS on update when I try to do a client request with "appwrite" on the client side ?

@Steven Is it possible to set headers for the "updateDocument" of "appwrite" function on the client side?

No, that would be a security vulnerability

This code seems not to to be the code you should be using

What's the SDK version you're using?

@D5 here is the version, but actually the main problem is not in SDK but in "appwrite", cuz I'm trying to use it on client side, I think you understand that

since an update method of appwrite
is giving CORS, I will use node-appwrite
in Nextjs , i think this is the only way I can do

NextJS uses server-side rendering. You should disable it for now for an easier development
Recommended threads
- Need help setting up this error is showi...
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cl...
- Appwrite stopped working, I can't authen...
I'm having an issue with Appwrite. It was working fine just a while ago, but suddenly it stopped working for me and can't authenticate accounts. I even went bac...
- Fail to receive the verification email a...
I added my email address to prevent it from showing "appwrite," but now I'm not receiving emails for verification or password resets. The function appears to be...
