
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
- Error getting session: AppwriteException...
I get this error `Error getting session: AppwriteException: User (role: guests) missing scope (account)` when running in prod. As soon as I try running my app o...
- PR Review and Issue Assign?
I am not familiar with how things work here. I know that Issue have to be assigned before solving problem, It is for not wasting contributors time but I like t...
- Need help with clerk auth
Im having issue with auth
