Troubleshooting CORS Origin problem in project

22 replies
Last updated: Feb 23, 2023
Hello everyone, any people available for a meeting to look on a connexion CORS Origin problem coming from my project ?
Have you added all your development and production URL's as CORS origins to your project's API settings?
yes all URL's as CORS has been implemented following step by step the tutorial mentionned here : https://www.sanity.io/docs/connect-your-content
and I don't understand why I encounter yet this problem
I also have added the npm install cors process and changed the interpretation of package.json file with
"type:" "module",
What are you using as a frontend?
as front end I use CSS
ans JS Vanilla
Do you use localhost:5500 for development?
yes exactly I am using 5500
And you have added http://localhost:5500 as a CORS origin?
totally
Make sure it's HTTP and not HTTPS
no https used it's well in http
wel your origin is not localhost, but 127.0.0.1, I think that's the problem.
You should be right
let me try
it's ok
thank you very much
I lost certainly my eyes on the desk ...
Np, happy to help πŸ˜„!
Thanks
user M
for helping! πŸ™‚

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?