Developers are encountering a CORS policy issue in their application related to Appwrite requests. The error occurs specifically in Chrome due to a browser extension. The issue is also related to the PATCH method not being allowed, causing a Network request failed error in the code when trying to update a document. A potential solution is to watch a video on common CORS errors or consider adjusting permissions and the hostname setup.
I've also change the hostname in my console to be a wildcard but I'm still getting the same error
D5
Feb 21, 2024, 23:38
Is this cloud or self-hosted?
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:39
error or my actual code?
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:39
cloud
D5
Feb 21, 2024, 23:42
Both
D5
Feb 21, 2024, 23:42
All the code related to appwrite and all the errors
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:47
Access to XMLHttpRequest at 'https://cloud.appwrite.io/v1/databases' has been blocked by CORS policy
Method PATCH is not allowed by Access-Control-Allow-Methods in preflight response.
Uncaught (in promise) AppwriteException: Network request failed
this is the only code related to appwrite that is failing
D5
Feb 21, 2024, 23:49
So everything works except that?
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:49
yes
D5
Feb 21, 2024, 23:49
Do you have some relationships?
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:49
no
D5
Feb 21, 2024, 23:51
And do you have set edit permissions?
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:52
yes, i have permission to create, read, update and delete set to any in my console
oyeins.dev
Rank 1: Thread
Feb 21, 2024, 23:52
i got this when i hovered over the updateDocument function in vscode
Update document
Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
@throws — {AppwriteException}
what's the patch method?
D5
Feb 21, 2024, 23:58
I think the doc ID is not correct or some of the data in the payload. Maybe ..proposal sin't correct?
oyeins.dev
Rank 1: Thread
Feb 22, 2024, 00:32
I just ran my application with firefox and it worked perfectly, but it's not working in chrome
oyeins.dev
Rank 1: Thread
Feb 22, 2024, 00:36
Thanks @Evdog and @D5 the error was caused by an extension I installed in chrome