You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using this module (in my case required by 'loadtest') together with 'lodash' you will get an error on execution.
The problem is that if you require 'prototypes' (or 'loadtest') first and then after that load 'lodash'; lodash will fail in index.js (12103).
lodash is searching for different functions and one is "toArray" - and exactly this is added by 'prototypes' to the prototype of "Object".
From my point of view you should avoid this kind of global Object manipulation with very generalized functions as "toArray" on the Object.prototype can be very commonly used (as well as other functions you are adding e.g. forEach, concat, isArray)
'lodash' is downloaded about 200.000 times the last day according to npm, so this issue might occur more often (and that's just lodash)
I can temporarily workaround the issue by changing the order of the require statements, but that's not a nice and clean solution.
Thanks for fixing.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed bug report and the dissection, it was very useful to reproduce and fix the issue quickly.
Solved in commit 96bca01, which has been released in version 0.4.0. Just update to the new loadtest v1.2.11 and it should solve the issue. Please reopen if it should be a problem again.
Hi,
using this module (in my case required by 'loadtest') together with 'lodash' you will get an error on execution.
The problem is that if you require 'prototypes' (or 'loadtest') first and then after that load 'lodash'; lodash will fail in index.js (12103).
lodash is searching for different functions and one is "toArray" - and exactly this is added by 'prototypes' to the prototype of "Object".
From my point of view you should avoid this kind of global Object manipulation with very generalized functions as "toArray" on the Object.prototype can be very commonly used (as well as other functions you are adding e.g. forEach, concat, isArray)
'lodash' is downloaded about 200.000 times the last day according to npm, so this issue might occur more often (and that's just lodash)
I can temporarily workaround the issue by changing the order of the require statements, but that's not a nice and clean solution.
Thanks for fixing.
The text was updated successfully, but these errors were encountered: