
I just moved my app to netlify hosting ( from replit ) and now I cannot even seem to get basic things working - when I try to access my api I get a CORS error:
Access to XMLHttpRequest at 'https://appwrite.denweaver.com/v1/account' from origin 'https://denweaver.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Does anyone have any insights on what I might be doing wrong?
The app is based on astro3 --- it was all working before :/

I did update my astro.config.mjs but I don't think this has anything to with the requested resource .. it's just for things asked for on my site I assume server: {
headers: {
"Access-Control-Allow-Origin": "*",
},
},

I also have a CNAME set on DNS to route api calls through my domain

Did you add vercel as a web platform in Appwrite?
https://appwrite.io/docs/getting-started-for-web#addPlatform

somehow I'm getting things to work, it seems like this is a side effect of not sending the right PROJECT_ID -- because my env variables are not working . let me keep snooping and see if fixing that works

That was going to be my next suggestion 😅

when I set PROJECT_ID manually it's "working " -- no CORS issue. I'll see if I can fix that

yes, issue solved - it was missing .env data so the client call was failing - the CORS issue was a ... red herring?

Seems yes

[SOLVED] Just moved app to netlify and I'm getting CORS issue please help

You're not putting a .env file in your repo are you?

no, that's why I didn't transfer, I'm adding the variables via Netlify's UI

It's working now

Thank you @Steven for your fast response - it really gives me confidence that you all are really committed to helping us use your service. I'm going all in with my site on appwrite
Recommended threads
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
- Stuck in "deleting"
my parent element have relationship that doesnt exist and its stuck in "deleting", i cant delete it gives me error: Collection with the requested ID could not b...
- Help with 409 Error on Relationship Setu...
I ran into a 409 document_already_exists issue. with AppWrite so I tried to debug. Here's what I've set up: Collection A has 3 attributes and a two-way 1-to-m...
