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
- I can't UNPAUSE my project with the free...
I received an email notifying me that my project had been paused due to inactivity, and the email included a link to "Restore project." However, that button red...
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- 401 - Project not accessible in this reg...
Hi Appwrite team, I’m experiencing a Cloud Console issue with my NYC region project. Problem: - Some Console pages return: “401 - Project is not accessible ...