browser icon indicating copy to clipboard operation
browser copied to clipboard

Maximum call stack size exceeded when running --debug

Open MartinSStewart opened this issue 4 years ago • 2 comments

The following app will throw a stack overflow exception on start up when the debugger is enabled. This occurs in both elm/browser 1.0.1 and 1.0.2

module Main exposing (main)

import Browser
import Html exposing (Html)
import Task
import WebGL exposing (Mesh)


init : ( Mesh Int, Cmd () )
init =
    ( List.repeat 10000 0 |> WebGL.triangleFan
    , Task.succeed () |> Task.perform (\_ -> ())
    )


main : Program () (Mesh Int) ()
main =
    Browser.element
        { init = \_ -> init
        , view = \_ -> Html.text ""
        , update = \_ model -> ( model, Cmd.none )
        , subscriptions = \_ -> Sub.none
        }

MartinSStewart avatar Nov 03 '19 18:11 MartinSStewart

https://discourse.elm-lang.org/t/rangeerror-maximum-call-stack-size-exceeded-when-decoding-a-long-list/4605/6 has a diagnosis.

https://discourse.elm-lang.org/t/rangeerror-maximum-call-stack-size-exceeded-when-decoding-a-long-list/4605/8 proposes a fix.

jerith666 avatar Nov 11 '19 02:11 jerith666

Looks like a duplicate of #104 (which also has a fix, #95).

jerith666 avatar Sep 24 '21 02:09 jerith666