elm / browser

Create Elm programs that run in browsers!
https://package.elm-lang.org/packages/elm/browser/latest/
BSD 3-Clause "New" or "Revised" License
313 stars 64 forks source link

Debugger stack overflow crash when msg triggered with large Set in model #132

Open adamdicarlo opened 1 year ago

adamdicarlo commented 1 year ago

I'm finding that a Set with 3551 or more elements causes this exception to happen in Elm's debugger when msgs are triggered:

I imagine this is related to, or a duplicate of, #104 , #90.

For me, a Dict with 10,000 as many items works just fine. So to work around this Set issue, I'm using Dict String () instead of Set String in one of my projects.

Crash output from the Ellie:

211 workspace:9414 Uncaught RangeError: Maximum call stack size exceeded
    at Function.f (VM211 workspace:9414:11)
    at A2 (VM211 workspace:56:28)
    at Function.f (VM211 workspace:9503:6)
    at A2 (VM211 workspace:56:28)
    at Function.f (VM211 workspace:9504:6)
    at A2 (VM211 workspace:56:28)
    at Function.f (VM211 workspace:9504:6)
    at A2 (VM211 workspace:56:28)
    at Function.f (VM211 workspace:9504:6)
    at A2 (VM211 workspace:56:28)

SSCCE

https://ellie-app.com/mVLVhb3DYk2a1

Tested on Chromium Version 113.0.5672.126 (Official Build, ungoogled-chromium) Arch Linux (64-bit).

The problem happens in Firefox, too, but it seems intermittent or something, so I'm not sure the exact number that triggers it (it seems higher than 3551). Guessing the exact number isn't very important, tho.