What's the bug?
The debugger seems to compare the old and new model whenever a new msg is triggered. When the model contains a large list it can throw a Maximum Call Stack size exceeded exception.
Other information
Happens only when the debugger is enabled
Depends on the call stack size limit of the browser. A list of length 5000 is enough to trigger the error on my Mac using Chrome v80
The error does not occur for a lower number(say 100)
The bug occurred using elm 0.19.1, elm/core 1.0.5 and elm/browser 1.0.2
The exact error msg is this:
SSCCE
module Main exposing (..)
import Browser
import Html exposing (Html, button, text)
import Html.Events exposing (onClick)
type Msg
= ButtonClicked
type alias Model =
{ longList : List () }
list =
let
{- Play with the listLength parameter to see that it works for smaller numbers.
Crashes in Chrome v80 with listLength = 5000
-}
listLength =
5000
in
List.range 0 listLength |> List.map (always ())
main =
Browser.document
{ init = \() -> ( { longList = list }, Cmd.none )
, update =
\msg model ->
case msg of
ButtonClicked ->
( model, Cmd.none )
, view =
\_ ->
Browser.Document "SWK NL Segmentation"
[ button [ onClick ButtonClicked ] [ text "Click me" ] ]
, subscriptions = \_ -> Sub.none
}
What's the bug? The debugger seems to compare the old and new model whenever a new msg is triggered. When the model contains a large list it can throw a
Maximum Call Stack size exceeded
exception.Other information
elm 0.19.1
,elm/core 1.0.5
andelm/browser 1.0.2
SSCCE