cljs.main: Browser script side effects don't always print

Description

"src/foo/core.cljs"

1 (println "hello")

Sometimes this works:

1 2 3 4 5 $ clj -Srepro -m cljs.main src/foo/core.cljs Compiling client js ... Serving HTTP on localhost port 9000 Listening for browser REPL connect ... hello

and other times it doesn't:

1 2 3 4 $ clj -Srepro -m cljs.main src/foo/core.cljs Compiling client js ... Serving HTTP on localhost port 9000 Listening for browser REPL connect ...

and when it fails the browser will log

1 2 [Log] Could not send {:type :print, :content "\"hello\"", :order 8} after 10 attempts. (repl, line 3272) [Log] Could not send {:type :print, :content "\"\\n\"", :order 9} after 10 attempts. (repl, line 3272)

making it appear that the REPL terminal is shutting down before the browser can flush its prints.

This seems very much related to CLJS-2574.

Environment

{:deps {org.clojure/clojurescript
{:git/url "https://github.com/clojure/clojurescript"
:sha "8971829275b466280a0b8fc85886e3fa7d353a13"}}}

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Major
Configure