Storefront error library · Requests and cart · Reviewed November 15, 2026
CORS error
on a Shopify store.
Access blocked by CORS policy: No Access-Control-Allow-Origin header. Why Shopify themes hit CORS errors calling apps and APIs, and the fixes, including App Proxy.
The short answer
A request to another host that does not allow your store’s domain. When the blocked request feeds something shoppers need, such as stock, delivery dates, bundle prices or a custom add to cart, that feature fails for everyone on the affected domain. Market domains make this easy to miss: the main store works and one country does not.
At a glance
CORS error in three lines.
| Who can fix it | The owner of the server being called |
|---|---|
| Does it cost sales? | When the blocked request feeds stock, prices or cart features |
| What Dozenfold does with it | Seen as a failed request without a status; kept out of the issue list |
| Group | Requests and cart |
| Last reviewed |
What you see
The exact messages.
The same problem is worded differently by each browser and tool. Search your console and error tracker for all of them.
What it means
In plain English.
Your storefront’s JavaScript asked a server on another origin for data, and that server did not say your store’s origin may read the answer. The browser blocked the response.
The page’s code only sees “TypeError: Failed to fetch”. The CORS reason is printed in the console for you, not passed to the page, so error trackers cannot tell CORS from a dropped connection.
Does it cost sales?
Which steps it can break.
When it happens on the path to purchase, look first at:
- Stock and delivery-date widgets
- Custom bundle and pricing features
- Wishlist, reviews and loyalty calls to app servers
Why it happens on Shopify
The usual causes.
Calling your own backend directly
A custom API or app server that allows one origin, or none, called from theme code.
More than one store domain
Market domains, the myshopify.com domain and preview URLs are all different origins. A server that allows only the main domain fails on the others.
Preflight requests
Custom headers or a JSON content type make the browser send an OPTIONS request first. A server that does not answer OPTIONS fails the preflight.
Calling the Admin API from the storefront
The Admin API is not meant for the browser, and an Admin token must never be in theme code. Use the Storefront API or a server.
Real problem or noise?
Check this before anyone debugs.
Most stores log this error at some level. These signals tell you whether real shoppers are affected.
- RealIt fails for every shopper on one domain or market.
- RealThe console names your own API or an app server behind a visible feature.
- NoiseA third-party tag fails with no feature on the page depending on it.
How to fix it
Reproduce, then fix.
- 01
Allow every store origin
On your server, answer with Access-Control-Allow-Origin set to the requesting origin when it is on your list of store domains, and answer OPTIONS preflights.
const allowed = new Set(['https://your-store.com', 'https://your-store.co.uk', 'https://your-store.myshopify.com']); const origin = request.headers.get('Origin'); if (allowed.has(origin)) { headers.set('Access-Control-Allow-Origin', origin); headers.set('Vary', 'Origin'); } - 02
Or use a Shopify App Proxy
An app proxy serves your app’s endpoint under the store’s own domain (for example /apps/your-app), so the request is same-origin and CORS does not apply.
- 03
Do not use mode: 'no-cors'
It hides the error by giving you an opaque response you cannot read. The feature still does not work.
- 04
Check every domain
Repeat the request on each market domain and on the myshopify.com domain, in DevTools → Network.
Find it automatically
Know which errors cost orders.
Dozenfold sees what your code sees: a request that failed without a status. It cannot tell CORS from a dropped connection, so these stay out of the issue list as network failures. Each one is kept in the session timeline with its host and the stack of the code that made it.
Sessions are broken down by landing page, country and page group, so a feature that fails on one market domain shows up as that country’s shoppers dropping at that step.
14-day trial · From $49 a month · Billed through Shopify
Questions
CORS error: FAQ.
Can I fix a CORS error in my theme code?
No. The server you are calling has to allow your origin. In the theme you can only call it through an App Proxy or a server you control.
Why does it work on my myshopify.com domain but not my real domain?
They are different origins. Add every domain the store answers on to the server’s allowed list.
Does the Storefront API have CORS problems?
The Storefront API is designed to be called from the browser with a public access token. CORS errors there usually mean a wrong endpoint or token.
Is CORS a security risk for my store?
CORS protects your shoppers: it stops other sites from reading responses with their data. Allow only your own origins, never a wildcard on endpoints that use cookies.
Written by the Dozenfold team, who build storefront error monitoring for Shopify. Reviewed November 15, 2026 against MDN: Cross-Origin Resource Sharing (CORS) and Shopify: About app proxies.