Thanks for the answer!
>The error tells you that the exception is happening in the browser. Did you look there to see what the browser stack trace is?
Yes, I did -- there's nothing in the browser console.
Also, I've tried this a couple of more times after posting this question and I sometimes get an InternalError instead of a RangeError. Not really sure what to make of that, though.
>As far as making the simplest possible REPL - the Quick Start has a better way
>I cannot see what purpose Socket REPL is serving here
Apologies, I should've been more precise in my initial post. I'm trying to get a minimal REPL running in a socket so that I can connect to it from my editor. The repro I provided doesn't do this, but for my real use case, I also need to override the :print and :caught hooks of cljs.repl/repl so that evaluation results and exceptions are printed in a way my editor plugin expects to receive them. I also need to get a hold of the compiler environment for editor auto-completion etc.
Please correct me if I'm wrong, but I don't think the Quick Start approach offers a way to do those things. This might be sort of off-topic for this question, though -- I can post another one on that topic. After all, I'm now not quite sure how to implement ClojureScript editor integration if I can't or shouldn't use the REPL APIs.
In any case, it's good to know that this approach is not recommended.
>So there might be a bug here but you will definitely need to minimize this further
Gotcha. The issue certainly seems related to clojure.browser.repl, but I will need to investigate more to say for sure.