ClojureScript

cljs.main: Browser REPL port not conveyed if --compile

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

This works:

$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -r
ClojureScript 1.10.439
cljs.user=> clojure.browser.repl/PORT
8090

but adding -c fails:

src/foo/core.cljs
(ns foo.core)
$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -c foo.core -r

with the REPL blocking and the browser log indicating:

[Error] Failed to load resource: Could not connect to the server. (repl, line 0)
http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22v9YNhZWQN3%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2Flocalhost%3A8090%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D

out/main.js has

var CLOSURE_UNCOMPILED_DEFINES = {};

Activity

Mike Fikes made changes -
Field Original Value New Value
Description This works:

{noformat}
$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -r
ClojureScript 1.10.439
cljs.user=> clojure.browser.repl/PORT
8090
{noformat}

but adding {{-c}} fails:

{noformat}
$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -c foo.core -r
{noformat}

with the REPL blocking and the browser log indicating:

{noformat}
[Error] Failed to load resource: Could not connect to the server. (repl, line 0)
http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22v9YNhZWQN3%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2Flocalhost%3A8090%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D
{noformat}

{{out/main.js}} has

{noformat}
var CLOSURE_UNCOMPILED_DEFINES = {};
{noformat}
This works:

{noformat}
$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -r
ClojureScript 1.10.439
cljs.user=> clojure.browser.repl/PORT
8090
{noformat}

but adding {{-c}} fails:

{code:title=src/foo/core.cljs}
(ns foo.core)
{code}
{noformat}
$ clj -Srepro -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.439"}}}' -m cljs.main -p 8090 -d out -c foo.core -r
{noformat}

with the REPL blocking and the browser log indicating:

{noformat}
[Error] Failed to load resource: Could not connect to the server. (repl, line 0)
http://localhost:9000/repl?xpc=%7B%22cn%22%3A%22v9YNhZWQN3%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2Flocalhost%3A8090%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2Flocalhost%3A9000%2Frobots.txt%22%7D
{noformat}

{{out/main.js}} has

{noformat}
var CLOSURE_UNCOMPILED_DEFINES = {};
{noformat}

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: