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

Maximum call stack size exceeded when running --debug #90

Open MartinSStewart opened 5 years ago

MartinSStewart commented 5 years ago

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
        }
jerith666 commented 5 years ago

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 commented 3 years ago

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