catchjs

What causes ReferenceError on live web sites?

ReferenceErrors happen when JavaScript code references variables that have never been declared. A common reason for this error is that one piece of code relies on another piece of code that has not been loaded.

This article and the ReferenceError Resolver is a result of our JavaScript Errors and Performance In The Wild 2020 study, where we crawled the 1 million most popular domains in order to learn about errors and performance on the web.
We do JavaScript error tracking for our customers. This time we decided to track errors on the entire web. The ReferenceError is the most common error on the internet, making up 46% of all errors found, occurring on 5.1% of all sites.

While rendering one million websites, we built up a dataset mapping JavaScript global variables to libraries. Use the tool to lookup the missing variable named in your error message, and find what library defines it.

ReferenceError Resolver

Click a property name to see the available data for the property.

Filter list:

If a ReferenceError appeared in your error log, it may indicate anything from a large to a miniscule problem. However, as with any uncaught JavaScript exception, it definitely means that some chain of execution was terminated when the error occurred, so it is worth investigating what has caused the problem. When these errors occur during development it is often obvious what has gone wrong, but when they appear seemingly out-of-the-blue on production sites, they can be deeply mystifying. The following generic troubleshooting guide may help fix the problem:

The twenty most common manifestations of ReferenceError in our crawl were the following:

Click the property names to look up the data on each property.

You might also be interested in our articles on SyntaxError and TypeError.