Storefront error library · JavaScript · Reviewed November 15, 2026
Script error.
on a Shopify store.
"Script error." is the browser hiding an error from a script on another host. Why Shopify stores see it, when it costs sales, and how to get the real message and line.
The short answer
An error from a script on another host, with its details hidden by the browser. On its own it tells you nothing, which is the problem. The same message covers a harmless error in a chat widget and an upsell app that breaks your Add to cart button. You cannot rank it until you know which script threw and on which step.
At a glance
Script error. in three lines.
| Who can fix it | The owner of the script that threw, usually an app or tag vendor |
|---|---|
| Does it cost sales? | Sometimes: when an app on the product or cart page throws |
| What Dozenfold does with it | Catches the real stack for errors in callbacks; filters the bare message as noise |
| Group | JavaScript |
| 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.
A script loaded from a different origin than the page threw an error. Browsers protect cross-origin scripts, so the page’s error handler receives only the words “Script error.”: no message, no file, no line, no stack.
The real error is not gone. The browser’s own DevTools console still prints it in full; only the page’s JavaScript, and every monitoring tool that listens on window.onerror, is kept from reading it.
Does it cost sales?
Which steps it can break.
When it happens on the path to purchase, look first at:
- Add to cart, when an app wraps the product form
- Cart drawer and upsell steps
- Variant pickers and bundle builders
Why it happens on Shopify
The usual causes.
App scripts
Review widgets, upsell drawers, chat, loyalty and bundle apps load JavaScript from their own hosts. Any error they throw reaches the page as “Script error.”
Tags and pixels
Tag managers, ad pixels and A/B testing snippets run from third-party hosts and are a common source.
Assets on a CDN host
Any script, including your own, served from a host that is not the page’s origin and loaded without the crossorigin attribute.
Browser extensions
Some extensions inject scripts into every page; their errors can surface the same way.
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 started after an app was installed or updated, and add-to-cart rates fell in the same browsers.
- RealThe console shows the same file throwing when you click on the product or cart page.
- NoiseIt appears on every page at a steady low rate, and the console points at an extension or an ad tag.
How to fix it
Reproduce, then fix.
- 01
Read the real error in DevTools
Open the page, open DevTools (Console), and reproduce the step. The console shows the full message and the file that threw it, even though window.onerror only got “Script error.”
- 02
Find the owner of the file
The host in the file URL tells you who can fix it: your theme, an app, or a tag. For an app, disable its app embed in a duplicate theme (Online Store → Themes → Customize → App embeds) and test again.
- 03
Load scripts you control with crossorigin
For a script on another host that you control, add crossorigin="anonymous" and make sure that host answers with an Access-Control-Allow-Origin header. Without the header, the browser refuses to run the script at all, so check the header first.
<script src="https://cdn.example.com/widget.js" crossorigin="anonymous" defer></script> - 04
Ask the app vendor for the stack
Send the vendor the page, the browser and the console message. Most app teams can reproduce from that.
Find it automatically
Know which errors cost orders.
Dozenfold wraps timers, event listeners and XHR callbacks the way Sentry does, so an error thrown inside them is caught with its real message and stack before the browser reduces it to “Script error.”, then rethrown unchanged.
A bare “Script error.” with nothing behind it is recorded as a cross-origin error and kept out of the issue list, as in Sentry’s default filters, so it cannot bury the problems you can act on. What does reach the list is labelled with its likely owner (theme, app, Shopify or extension) and ranked by the orders it is estimated to cost.
14-day trial · From $49 a month · Billed through Shopify
Questions
Script error.: FAQ.
Is "Script error." a bug in my theme?
Usually not. It means a script from another host threw. Your theme files served from your own store domain report full errors; check the console to see which file it really was.
Why does my error tracker show "Script error." with line 0?
The browser hid the details from the page. Every tool that reads window.onerror receives the same empty error. Tools that wrap callbacks, such as Sentry and Dozenfold, can still catch many of these with a stack.
Should I add crossorigin="anonymous" to every script?
Only to scripts whose host sends an Access-Control-Allow-Origin header. On a host without it, the attribute makes the browser block the script, which is worse than the hidden error.
Can I ignore "Script error."?
You can filter the bare message from alerts, as Sentry does by default. Do not ignore the step it happens on: if shoppers who see it stop adding to cart, an app is breaking your store.
Written by the Dozenfold team, who build storefront error monitoring for Shopify. Reviewed November 15, 2026 against MDN: window error event and “Script error.” and MDN: the crossorigin attribute.