TapCub is live — analytics, insights and live chat, free on one platform
Glossary

What is a JavaScript error? Types, impact and how to triage them

A JavaScript error means the browser could not run part of a script. Which types appear in reports, what monitoring misses, and how to tell the errors that stop visitors from the ones that are only noise.

Chen Yu Reviewed by Ethan Brooks Also called JS error Last updated Nov 17, 2026 Glossary

Quick answer

A JavaScript error happens when the browser cannot parse or run a script as written, so the code that failed stops and the feature it powered may not work. Visitors usually see no message. What matters is which errors stop a task and how many sessions they touch, not how often they occur.

Formula: Error rate = JavaScript error count ÷ pageviews

What a JavaScript error is

A JavaScript error happens when the browser cannot parse or run a piece of script the way it was written. The engine creates an error object, the line that failed stops, and whatever that code was meant to do (open a menu, validate a form, send an order) may not happen. The visitor usually sees nothing: no message, just a button that does nothing.

That is why a JavaScript error is different from the errors people usually monitor. An HTTP 500 error is the server failing to answer; a soft 404 is a missing page that returns a success code. A JavaScript error can happen on a page that loaded perfectly, with a 200 status and a fast response, so server-side monitoring never sees it. The count only exists if the visitor's browser reports it.

Types of JavaScript error

MDN lists the built-in error types. In practice, six situations account for most of what a monitoring report shows:

What it isWhen it is thrownWhat the visitor noticesExample message
SyntaxErrorThe script cannot be parsedThe whole file does not run, so everything it controls is deadUnexpected token '<'
TypeErrorA value is not the type the code expectsOne feature fails, often a button or a formCannot read properties of null (reading 'value')
ReferenceErrorThe code uses a name that does not existOne feature fails; common with third-party tags that did not loadgtmFoo is not defined
RangeErrorA number is outside the allowed rangeRare; often a runaway loop or a recursion that never endsMaximum call stack size exceeded
Unhandled promise rejectionA promise failed and nothing handled the failureA request that silently never completesUncaught (in promise)
Cross-origin "Script error."A script from another origin threw, and the browser hid the detailsUnknown; you cannot tell which line or which featureScript error.

Two more things are often reported next to errors but are different: a failed resource load (an image or script file that returned 404 or was blocked) and a console warning. Neither stops other code from running by itself.

Which errors reach a monitoring report

Not every error that happens is counted, and tools do not count the same set:

  • Errors you catch yourself never appear. Code wrapped in try/catch that swallows the error looks healthy in every report, even if the feature is broken.
  • Synchronous errors and promise rejections are separate events. Per MDN, the window error event is only generated for script errors thrown synchronously; a rejected promise with no handler fires unhandledrejection instead. A tool that listens to only one will report a structurally lower number than a tool that listens to both, so two tools rarely agree.
  • Cross-origin scripts are muted. For a script from another origin, the HTML Standard hides error details to avoid leaking private information, and the browser reports only Script error. with no file, line or column. The fix belongs to the script's owner: serve it with an Access-Control-Allow-Origin header and load it with crossorigin="anonymous", as Sentry's troubleshooting guide describes.
  • An empty list is not proof of a healthy site. If the collector was never turned on, or the snippet is old, the count is zero because nothing was listening.

Breaking errors and noisy errors

A site can easily produce thousands of errors a week, and most do not cost anything. The useful split is by what the error stops, not what it is called:

  • Breaking: it stops a task the visitor came to do (pay, sign up, send a message, load the main content). Fix first.
  • Degrading: it breaks something secondary (a carousel, a tooltip, an analytics tag). Fix when convenient.
  • Noise: it comes from code you do not control, from very old browsers you do not support, or from a loop that repeats one failure many times. Filter or ignore it, but keep a note of why.

Three questions put an error into one of those groups:

  1. How many sessions does it touch? Count sessions or visitors, not occurrences. One browser stuck in a retry loop can produce hundreds of errors from a single person.
  2. Where does it happen? The same error on /checkout and on an old blog post has a very different cost.
  3. Did it start after a release? A step in the trend line that lines up with a deploy points at the change that caused it.

Then open one affected session and look at what the visitor did next. If they left or retried the same action, the error is breaking.

Worked example: five error groups, one week

Sample data: a week with 150,000 pageviews and 45,000 sessions. The error report shows five groups.

GroupErrorPageOccurrencesSessionsShare of that page's sessions
ATypeError: Cannot read properties of null (reading 'value')/checkout908585 ÷ 1,200 = 7.1%
BChat script failed to load, retried repeatedlyall pages2,4004040 ÷ 45,000 = 0.09%
CScript error. from a third-party tagall pages600520520 ÷ 45,000 = 1.16%
DReferenceError: gtmFoo is not defined/pricing150140140 ÷ 2,100 = 6.7%
ESyntaxError on an old browserblog706666 ÷ 45,000 = 0.15%

Total occurrences are 90 + 2,400 + 600 + 150 + 70 = 3,310, so the error rate is 3,310 ÷ 150,000 = 2.2% (errors per pageview).

Sorting by occurrences gives B, C, D, A, E. Sorting by sessions gives C, D, A, E, B. Group B has the biggest count and the smallest reach: 2,400 ÷ 40 = 60 errors per session, a retry loop in a few browsers. Neither ranking puts the real problem first, so look at the outcome. Of the 85 sessions with error A, 9 completed a purchase (10.6%); the other 1,115 checkout sessions converted 280 times (25.1%). For error D, 11 of 140 pricing sessions signed up (7.9%) against 156 of 1,960 others (8.0%), so D costs nothing measurable today.

The order of work: A first (it blocks payment), then C (find out whose script it is and ask for the CORS header, because you cannot fix what you cannot see), then D as a cleanup. B needs a stop condition for the retry, and E may simply be ignored.

Common mistakes

  • Ranking by occurrences. The top row is often one loop in one browser. Rank by sessions first, then by page.
  • Treating zero as healthy. Check that collection is on before reading an empty report.
  • Ignoring Script error. It cannot be debugged from your side, yet it can be hundreds of sessions. Raise it with the script's owner or remove the tag.
  • Comparing one tool's rate with another's. Different listeners and different denominators (pageviews, sessions, requests) give different numbers. The error rate definition has to match before the values do.
  • Chasing old-browser errors. An error on a browser version that is under 1% of sessions can be a policy decision, not a bug.
  • Closing a group without checking again. A fix that ships is only fixed if the group stays quiet for the next week.
  • Confusing a slow page with an error. Load time is a separate measurement; a page can be slow with no error and broken with perfect speed.

Errors that real visitors hit show up only after someone hits them. For problems you want to find before visitors do, scripted checks from outside, such as synthetic monitoring, complement an error report rather than replace it.

JavaScript errors in TapCub

Take the example above and run it in TapCub. The full walkthrough is in find JavaScript errors.

  1. Check collection is on. In Web analytics › Configuration › SDK code, make sure JavaScript errors is turned on and the snippet contains data-errors="true". If it is off, a notice at the top of Monitoring › Errors says so.
  2. Read the cards. Monitoring › Errors shows error count, error rate (error count ÷ pageviews), affected visitors and affected sessions. The trend is error count over time, so a step after a release stands out.
  3. Sort groups by sessions. Each group has a count, the sessions involved and when it was last seen. Expand one to see each occurrence's time, page, place, device and session. This is where error B (60 errors per session) separates from error A.
  4. Open a session. Open session shows what the visitor did before and after the error, which answers whether it was breaking.
  5. Close the loop. Mark a finished group Resolved or Ignored to take it out of Active. A frustration table under the groups lists pages where a script error followed a click within 1 second (an error click) or where people clicked the same element at least 3 times within 500 milliseconds (a rage click); a page needs at least 20 pageviews to be listed.

TapCub's error page has no previous-period comparison, so change the date range yourself to compare weeks. TapCub reports errors but does not fix them or decide for you which one is breaking; that call is the session check in step 4. The page is real visits only, so errors on a page nobody has opened do not appear.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Chen Yu

Technical Engineer

Focuses on tracking code, SDKs, and API integrations, with practical guidance on implementation checks and troubleshooting.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is a JavaScript error in simple terms?

It is a failure in the code that runs in a visitor's browser. The browser stops that piece of code, and whatever it was meant to do, such as submitting a form or opening a menu, may not happen. The page still loads normally, so the visitor often sees nothing.

How is a JavaScript error different from an HTTP error?

An HTTP error, such as a 500, is the server failing to answer. A JavaScript error happens in the browser after the page has loaded, so the server logs show a normal response. It can only be counted if the visitor's browser reports it.

Which JavaScript errors should I fix first?

Fix errors that stop a task people came to do, on pages that matter, and that touch many sessions. Rank by sessions affected, not by occurrences, then open one session to check what the visitor did next. Errors from third-party code or old browsers can usually wait.

Why do I see "Script error." with no details?

The script came from another origin and the browser hid its error details. To see them, the script owner must send an Access-Control-Allow-Origin header and the page must load it with crossorigin="anonymous". Otherwise the error is hard to act on.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics