Top 10 JavaScript Errors
Top 10 JavaScript Errors
Written by Ian Elliot   
Monday, 29 January 2018

Know your enemy is good advice, but do you know the most common errors made in your favourite programming language? Rollbar has looked at more than 1000 real world projects and made a list of the ten most common errors in JavaScript.

Rollbar is an error logging utility that includes remote reporting so it's a natural for collecting the problems that occur with real JavaScript programs in production.

So what do you think the most common errors are going to be?

The ten errors are:



The first two are a bit of a cheat because they are the same error as reported by Chrome and Safari, but if you look more closely most of the errors are of a single type - trying to use a property or method that an object doesn't have. At this point it is tempting to conclude "what else do you expect from a weakly typed dynamic language!". However, these are runtime errors and might well have not been picked up by strong typing.

The Rollbar blog speculates that the majority of these problems occur because of race conditions in asynchronous operations. For example, trying to access a DOM element before the component has finished loading.

Knowing that using properties or methods that don't exist is the biggest set of errors in JavaScript is interesting, but really it just confirms our expectations. What would be more interesting is really knowing why these errors occur. After all, if you make the sort of error that strong typing would pick up at compile time, then you are going to see a similar error at runtime as soon as the faulty code is executed. The question is what happens to make an object that should have a property or method not have that property or method at runtime?

The only cases I can think of are the race condition already described and similar and the occurrence of edge cases where functions fail to return an object at all.

More data required.


More Information

Top 10 JavaScript errors from 1000+ projects (and how to avoid them)

Related Articles

JavaScript The Language With Two Names    

The JavaScript Encyclopedia Work In Progress 

JavaScript Added To Oxford English Dictionary 

JavaScript 6 EcmaScript 2015 Final Approval 

JavaScript 20 Years Old Today 



To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.



Women In Tech - Towards Gender Parity

Today is International Women's Day, a key date in the ongoing campaign for gender parity, and this year's theme is #PressforProgress. HackerRank has published findings relating to gender inequality in [ ... ]

Nim Improves Async

There's a new release of Nim, the systems programming language that focuses on performance, portability and expressiveness. Nim, which was formerly called Nimrod, is statically typed and compiled.

More News



or email your comment to:

Last Updated ( Monday, 29 January 2018 )

RSS feed of news items only
I Programmer News
Copyright © 2018 All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.