Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource
Unanswered
Longtail tuna posted this in #help-forum
Longtail tunaOP
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
So, i had no problems fetching from server side but on client CORS are not being allowed, i tried setting headers on next.config.mjs like on next documentation (https://nextjs.org/docs/pages/api-reference/config/next-config-js/headers#options) but didn't succeed
this is trying to fetch documents from sanity.
So, i had no problems fetching from server side but on client CORS are not being allowed, i tried setting headers on next.config.mjs like on next documentation (https://nextjs.org/docs/pages/api-reference/config/next-config-js/headers#options) but didn't succeed
this is trying to fetch documents from sanity.
3 Replies
Brown bear
That sounds like your have CORS issues from sanity and not nextjs. Might need more context, but this may help https://www.sanity.io/docs/cors
Longtail tunaOP
yep, i specified CORS for https instead of http on sanity project
silly me