Open xerxesb opened 7 years ago
did you fix that? i am stuck with the same problem...
Same problem here. Anyone know how to fix?
Same problem :(
same problem !!!!!!!!!!!!!!!
same problem !!!!!!!!!! ! ! ! ! ! !!!!!
Check your Array.prototype scope, it's probably polluted. e.g. if you hava Array.prototype.something = function() {...} for(var x in ['a']) will return something as the last element, which node-rest-client is not expecting.
@mattdawson thanks; i had added Array.prototype.random()
and turns out for (var x in ['a'])
included random
.
@mattdawson but why node-rest-client depends on what user do with Array or Object prototype ?
@maroodb i think because when you simply assign a new property like Array.prototype.random = ...
it creates an enumerable property on all instances of Array, so when you iterate over an array's values with a for...in loop, it includes the inherited property you added. The built-in Array methods are not enumerable, so to properly extend the Array class you have to define it as not-enumerable too:
Object.defineProperty(Array, "random", {
value: function () {...},
enumerable: false
});
@ledlamp I think to avoid those type of problems when we develop a library we shouldn't depends on user manipulations, thank's
Hi,
I recently updated from v1.8 to v3.1 to pull a JSON object from a Google Sheets script via a few redirects.
I'm now getting the following error when trying to hit the endpoint. Appreciate any help.
Thanks.