Originally, I’ve shared this article to Syndicode blog.
‘Rollbar’ did an interesting experiment. They’ve collected all the errors they faced and summarized how many times each one occurred. That helped to see the actual statistics with the most spread errors.
Here they are,
- Uncaught TypeError: Cannot read property. This one occurs in Chrome when you read a property or call a method on an undefined object.
- TypeError: ‘undefined’ is not an object (evaluating). This is an error that occurs in Safari when you read a property or call a method on an undefined object.
- TypeError: null is not an object (evaluating). This is an error that occurs in Safari when you read a property or call a method on a null object.
- TypeError: Object doesn’t support property. This is an error that occurs in IE when you call an undefined method.
- TypeError: ‘undefined’ is not a function. This is an error that occurs in Chrome when you call an undefined function.
- Uncaught RangeError: Maximum call stack. This is an error that occurs in Chrome under a couple of circumstances.
- TypeError: Cannot read property ‘length’. This is an error that occurs in Chrome because of reading length property for an undefined variable.
- Uncaught TypeError: Cannot set property. When we try to access an undefined variable it always returns undefined and we cannot get or set any property of undefined.
- ReferenceError: event is not defined. This error is thrown when you try to access a variable that is undefined or is outside the current scope.
It turns out that a lot of these are null or undefined errors. A good static type checking system like Typescript can help you avoid them if you use the strict compiler option.
Anyway, you’d better read about all of these errors in details here.
Also, check myJS digests to know all the most popular recent repositories.