One of the reasons why you might get this error is because you added new properties (usually methods) to Object.prototype
Example:
Object.prototype.someNewMethod = function (value1, value2) {
This method of adding new properties to Object not recommended, as indicated in issue # 1033 for the express project. Object.defineProperty should be used instead of enumerable instead of false .
Example of extending Object using Object.defineProperty
Object.defineProperty( Object.prototype, 'someNewMethod', { writable : false, // Will not show up in enumerable properties (including for-in loop). enumerable : false, configurable : false, value : function (value1, value2) { // ... perform some operations return this; } } );
I had exactly the same problem and Object.defineProperty problem using Object.defineProperty with enumerable:false to define new properties.
I hope this helps.
source share