Code Monkey home page Code Monkey logo

Comments (14)

marchant avatar marchant commented on June 24, 2024 2

I just published the latest master as version 5.1.13.

from collections.

marchant avatar marchant commented on June 24, 2024 1

Committed a tentative fix on master, please try it and let me know if it fixes it.

from collections.

matthiasg avatar matthiasg commented on June 24, 2024 1

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.

redboltz avatar redboltz commented on June 24, 2024 1

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.

ejames17 avatar ejames17 commented on June 24, 2024

same here. I rolled back to v5.0.0

from collections.

robross0606 avatar robross0606 commented on June 24, 2024

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.

Robula avatar Robula commented on June 24, 2024

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.

NebzHB avatar NebzHB commented on June 24, 2024

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.

NorthernMan54 avatar NorthernMan54 commented on June 24, 2024

@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.

NebzHB avatar NebzHB commented on June 24, 2024

this fix doesn't fix the issue :( i've tried it

from collections.

NorthernMan54 avatar NorthernMan54 commented on June 24, 2024

@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.

NebzHB avatar NebzHB commented on June 24, 2024

not to all of them, i'll try

from collections.

NebzHB avatar NebzHB commented on June 24, 2024

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.

NorthernMan54 avatar NorthernMan54 commented on June 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.