Comments (14)
I just published the latest master as version 5.1.13.
from collections.
Committed a tentative fix on master, please try it and let me know if it fixes it.
from collections.
Just wanted to use collections for the first time. The algorithms implemented looked decent, but to be honest, I am quite disappointed that importing e.g. collections/sorted-map
would shim global objects. Not only because of the above error I just fell in as well, and going back to 5.0.0 did not help (it does not seem to support generators ?).
In general I find shimming of global objects like overwriting Array.from
something to be avoided. If it absolutely has to be, it should be an opt-in feature.
I do not see a need for SortedMap for example to shim anything. As shimming seems to be deeply embedded, the risk of it breaking existing code at a fundamental and global level is just too high.
from collections.
I tried to reproduce the issue using minimal code.
When I import (emulation code) version 5.1.12 once, it works fine.
https://wandbox.org/permlink/hmddUMmg9KvZGz94
However, I import version 5.1.12 twice, then infinity recursive call happens.
https://wandbox.org/permlink/bmniUnfwt8nqlrVB
If import order is 5.1.12 -> master, then it works fine.
https://wandbox.org/permlink/a6ttiL4PrB59cnN6
If import order is master -> 5.1.12, then infinity recursive call happens.
https://wandbox.org/permlink/SqR662bKByM5pou6
If import master twice, then it works fine.
https://wandbox.org/permlink/NhufBWIaU42d6aa6
NOTE: master is 85f00f8
So in order to fix the issue, all of collections library need to update.
(The first import is exception but depending on the order is dangerous)
After the current master including 85f00f8 fix would be released, and then all collections.js users would update the library, I guess that the issue would be fixed.
from collections.
same here. I rolled back to v5.0.0
from collections.
Seeing same thing here for me:
RangeError: Maximum call stack size exceeded
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:30:5)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
at Function.Object.<anonymous>.Array.from [as nativeFrom] (node_modules/collections/shim-array.js:31:22)
I could not get it to work fixed a version 5.0.0 either. Had to stop using it altogether as it interferred badly with Apollo GraphQL API. This looks to be using Monkey patching which is asking for trouble.
from collections.
We've just hit this too on 5.1.12
. Forcing the resolution to 5.0.0
has worked.
Note: We aren't using collections
directly, it is a transitive dependency via another package.
EDIT: @marchant For the sake of this issue and your request, I tried your fix on master
and it works. 👍
from collections.
Dears,
I have the same problem when using collections on dependancies of homebridge-alexa (in mqtt dependancies) :
RangeError: Maximum call stack size exceeded
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
at Function.Array.from (/usr/local/lib/node_modules/homebridge-alexa/node_modules/collections/shim-array.js:32:22)
5.1.12 is installed but doesn't contain the if(!Array.nativeForm)
condition on line 32. but even if i use it, i still have the error (on line 35)...
the error is on the return Array.nativeFrom(values, mapFn, thisArg);
from collections.
@marchant - Is it possible to get this fix pushed out as a release ?
In the homebridge community we have had numerous users of our packages impacted by this issue due to the usage of mqtt.
from collections.
this fix doesn't fix the issue :( i've tried it
from collections.
@NebzHB - When I was testing, I applied the fix to all the plugins leveraging collections and that appeared to resolve the issue. Did you try that
from collections.
not to all of them, i'll try
from collections.
well... homebridge-camera-ffmpeg seems to still use it (^4.2.8) but doesn't crash here... so with only changing homebridge-alexa, it doesn't solve. but push to release anyway, we'll see ;)
from collections.
@marchant Tks very much I just updated my test environment and can no longer recreate the issue. ( I validated that npm had installed collections 5.1.13 )
@redboltz tks for the pull request against mqtt
from collections.
Related Issues (20)
- Assess whether dispatchBeforeOwnPropertyChange and co have ever been used in any real project HOT 3
- row.toArray is not a function while use where or orderBy function
- Missing Tree
- Deque is missing from collections.min.js
- Collections interrupt MongoDB connection
- Typo in the documentation for findGreatestLessThan()
- List findValue is not a function
- A question of collections usage to solve Typescript issue related to tuple key in hashmap HOT 1
- How to use collections in Angular? HOT 4
- shim-array version of Array.from not compatible with object with length property HOT 4
- Add data structure Trie HOT 1
- [feature request] SortedMap pop and shift methods
- MultiMap doesn't seem to be functioning properly
- updating the contentCompare in SortedSet
- Set behavior vary from Browser vs Node? HOT 6
- Add browser support where eval is not allowed by CSP HOT 1
- fast-map breaks mercurius
- Bugs in negated `in` expressions
- Is collections.js dead?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from collections.