Unlock seamless workflows and faster delivery with our latest releases - Join the deep dive

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 ?
Feb 23, 2023, 10:58 AM
Have you added all your development and production URL's as CORS origins to your project's API settings?
Feb 23, 2023, 11:16 AM
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
Feb 23, 2023, 11:56 AM
and I don't understand why I encounter yet this problem
Feb 23, 2023, 11:57 AM
I also have added the npm install cors process and changed the interpretation of package.json file with
"type:" "module",
Feb 23, 2023, 11:58 AM
What are you using as a frontend?
Feb 23, 2023, 12:00 PM
as front end I use CSS
Feb 23, 2023, 12:02 PM
ans JS Vanilla
Feb 23, 2023, 12:02 PM
Do you use localhost:5500 for development?
Feb 23, 2023, 12:02 PM
yes exactly I am using 5500
Feb 23, 2023, 12:03 PM
And you have added http://localhost:5500 as a CORS origin?
Feb 23, 2023, 12:04 PM
totally
Feb 23, 2023, 12:04 PM
Make sure it's HTTP and not HTTPS
Feb 23, 2023, 12:04 PM
no https used it's well in http
Feb 23, 2023, 12:06 PM
wel your origin is not localhost, but 127.0.0.1, I think that's the problem.
Feb 23, 2023, 12:07 PM
Feb 23, 2023, 12:07 PM
You should be right
Feb 23, 2023, 12:07 PM
let me try
Feb 23, 2023, 12:07 PM
it's ok
Feb 23, 2023, 12:08 PM
thank you very much
Feb 23, 2023, 12:08 PM
I lost certainly my eyes on the desk ...
Feb 23, 2023, 12:09 PM
Np, happy to help šŸ˜„!
Feb 23, 2023, 12:09 PM
Thanks
user M
for helping! šŸ™‚
Feb 23, 2023, 4:16 PM

Sanityā€“ build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?