Generic answer would be "this error can occur if you are trying to use an object which is null."
In general, when you are using an object, its a better practice to check object for nullability to avoid such surprises.
Also a try-catch block surrounding any critical functionality would also stop ugly errors showing up on browser. For more details check
www.w3schools.com/js/js_errors.asp[
^]
Please provide code snippet where this error is occuring then we might be able to give you pin-point answer.
Hope that helps
Milind