I ran into the error when decoding a json value which contained a list that had over 4000 elements. I found old posts and github issues about similar situations, but none had concrete steps to fix it other than to update to the latest version of elm. I did try running the app without the debugger and it did work then, but that’s not really a solution as the debugger is pretty useful at times.
My elm version is 0.19.1-3 from npm.
My code is below.
import Json.Decode as Decode
import Json.Decode.Pipeline as Pipeline
import List.Extra as ListExtra
type Enums
= Enums (List Data)
type alias Data =
{ enumType : Type
, id : String
, name : String
}
type Type
= Application
| Operation
| IdType
| PayloadType
| MetadataName
This file describes the generic model description used in the debugger. It turns your statically typed model into a “dynamically typed” Expando, which is the data structure used to render the model on the right side (including open/closed states).
Because it needs to do the Cons (::) after it calls mergeListHelp, this call is not tail-recursive. It’s esentially a map iterating 2 lists at once, which itself is essentially a right fold. Except that unlike List.map and List.foldr, this function does not include special handling of deep recursive structures.
Because the Debugger is only loaded when enabled (duh!), it works without it.
PS: The Elm Debugger is just another (special) Elm App. I think that’s pretty awesome!
Should be fixable to tail recursive - usually takes me a while to remember how to do it, but I’ll be back with a tail recursive version unless someone beats me to it.
I encountered the same issue (Maximum call stack size exceeded)-
elm 0.19.1-3, elm/browser 1.0.2 and elm/browser 1.0.1
With a simple application that holds a List with more than 4000 entries. The debugger just crashes as soon as a message is triggered, even if the update function just returns the same model -
But this happens only in Chrome/ Chromium!
Everything works fine with Firefox or elm 0.19