Back

[SOLVED] Reason: CORS header ‘Access-Control-Allow-Origin’ does not match

  • 0
  • Self Hosted
  • Web
ZachHandley
7 Sep, 2023, 23:54

As the title says, I've deployed my page to https://dailymatchup.com and changed the WebSDK URL in my Appwrite instance, but it's still telling me

TypeScript
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://appwrite.mydomain.com/v1/account/sessions/email. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘https://localhost’).

why this do this

TL;DR
The user was facing an issue where the CORS header 'Access-Control-Allow-Origin' was not matching. The user realized that their build and deploy scripts were running simultaneously, resulting in the deployment of the previous build. The issue was resolved by installing an older version of the package 'appwrite' (v1.3.8) instead of the newest version. The user also made sure to add the correct hostname to the web platform in their project.
Drake
8 Sep, 2023, 00:15

did you add a web platform in your project for this hostname? https://appwrite.io/docs/getting-started-for-web#addPlatform

ZachHandley
8 Sep, 2023, 00:17

yes

ZachHandley
8 Sep, 2023, 00:17
ZachHandley
8 Sep, 2023, 00:17

I added dailymatchup.com, tried *.dailymatchup.com and dailymatchup.com* too, and it just says the CORS is localhost?

ZachHandley
8 Sep, 2023, 00:17

this is on 1.3.8

Drake
8 Sep, 2023, 00:18

it should jsut be dailymatchup.com

Drake
8 Sep, 2023, 00:19

btw, you're using the wrong sdk version for 1.3.8. you should be using 11.0.1: https://github.com/appwrite/sdk-for-web/tree/11.0.1

ZachHandley
8 Sep, 2023, 00:20

it's the one installed by yarn install appwrite but

ZachHandley
8 Sep, 2023, 00:21

upgraded that

Drake
8 Sep, 2023, 00:25

that will always install the newest package...but the newest package is for appwrite 1.4. you need to install an older version

ZachHandley
8 Sep, 2023, 00:27

okay so I installed yarn add appwrite@11.0.1

Drake
8 Sep, 2023, 00:33

have you redeployed?

Drake
8 Sep, 2023, 00:33

and updated this?

ZachHandley
8 Sep, 2023, 00:43

yes

ZachHandley
8 Sep, 2023, 00:43

and yes

ZachHandley
8 Sep, 2023, 00:48

one sec

ZachHandley
8 Sep, 2023, 01:56

Okay so my build script was runnin and my deploy script was running at the same time, therefore deploying my previous build, thank you for your help Steven!

Drake
8 Sep, 2023, 02:21

[SOLVED] Reason: CORS header ‘Access-Control-Allow-Origin’ does not match

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