Uncaught RangeError: Maximum call stack size exceeded

I was playing a bit more with Elm and made this Ellie, trying to sort a large list of 10,000 elements:


However, when I click on the Toggle Sort button, I get an exception:

Uncaught RangeError: Maximum call stack size exceeded

Am I doing something silly here or did I hit some kind of limit in Ellie? :thinking:


1 Like

Did some digging and it appears to be bad recursion in the serialization function for the debugger (Ellie always includes the debugger). I suspect if you compile this locally without the debugger it’ll work.

It does indeed work for me in elm reactor on my machine. Looking at the JS code for the Kernel implementations of List.sort and List.sortWith revealed no reason it would EVER stack overflow, unless there’s a bug in the browser’s JavaScript sort function on arrays.

Exactly. In fact I think the debugger causing “max call stack size exceeded” errors is already a known issue (although I couldn’t find it on the elm/compiler repo (edit) or elm/browser which actually has the debugger code)

I see — I didn’t have access to a computer with Elm installed, but now I tried it locally and it does seem to work fine.

I’d like to report the issue, but I’m not sure where it should go — do you think it’s it Ellie-specific (for ellie-app/ellie?) or shall I just open it direct in elm/core?

@svilen It seems to be a problem with the Elm debugger so you should open the issue on elm/core

Great, thanks! Link to issue if anyone wants to follow: https://github.com/elm/core/issues/986

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.