adzerk-oss / boot-cljs-repl

Boot task providing a REPL for ClojureScript development.
Eclipse Public License 1.0
72 stars 28 forks source link

boot repl --client fails with Assert failed: host and/or port not specified for REPL client #27

Closed mbertheau closed 9 years ago

mbertheau commented 9 years ago

This is my build.boot:

(set-env!
  :source-paths   #{"src"}
  :resource-paths #{"html"}
  :dependencies '[
    [adzerk/boot-cljs            "0.0-3308-0"      :scope "test"]
    [adzerk/boot-cljs-repl       "0.1.10-SNAPSHOT" :scope "test"]
    [adzerk/boot-reload          "0.3.1"           :scope "test"]
    [pandeiro/boot-http          "0.6.3"           :scope "test"]
    [crisptrutski/boot-cljs-test "0.1.0-SNAPSHOT"  :scope "test"]
    [org.clojure/clojure         "1.7.0"]
    [org.clojure/clojurescript   "1.7.48"]
    [reagent "0.5.1"]
    [re-frame "0.4.1"]])

(require
  '[adzerk.boot-cljs      :refer [cljs]]
  '[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]
  '[adzerk.boot-reload    :refer [reload]]
  '[crisptrutski.boot-cljs-test  :refer [test-cljs]]
  '[pandeiro.boot-http    :refer [serve]])

(deftask auto-test []
  (set-env! :source-paths #{"src" "test"})
  (comp (watch)
        (speak)
        (test-cljs)))

(deftask dev []
  (set-env! :source-paths #{"src"})
  (comp (serve :dir "target/")
        (watch)
        (speak)
        (reload :on-jsload 'app.core/mount-root)
        (cljs-repl)
        (cljs :source-map true :optimizations :none)))

(deftask build []
  (set-env! :source-paths #{"src"})
  (comp (cljs :optimizations :advanced)))

my ~/.boot/profile.boot:

(require 'boot.repl)
(swap! boot.repl/*default-dependencies*
       concat '[[cider/cider-nrepl "0.10.0-SNAPSHOT"]
                [refactor-nrepl "1.2.0-SNAPSHOT"]
                [org.clojure/tools.nrepl "0.2.10"]])

(swap! boot.repl/*default-middleware*
       conj 'refactor-nrepl.middleware/wrap-refactor)

And the terminal output:

$ boot repl --client
             clojure.lang.ExceptionInfo: java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
                                         (and h p)
    data: {:file "/tmp/boot.user245463565904755740.clj", :line 27}
java.util.concurrent.ExecutionException: java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
                                         (and h p)
               java.lang.AssertionError: Assert failed: host and/or port not specified for REPL client
                                         (and h p)
            boot.repl-client/client  repl_client.clj:   10
                                ...                       
                 clojure.core/apply         core.clj:  630
              boot.pod/eval-fn-call          pod.clj:  184
                  boot.pod/call-in*          pod.clj:  191
                                ...                       
                  boot.pod/call-in*          pod.clj:  194
        boot.task.built-in/fn/fn/fn     built_in.clj:  276
                                ...                       
                 clojure.core/deref         core.clj: 2206
     boot.task.built-in/fn/fn/fn/fn     built_in.clj:  282
     boot.task.built-in/fn/fn/fn/fn     built_in.clj:  278
                boot.core/run-tasks         core.clj:  695
                  boot.core/boot/fn         core.clj:  705
clojure.core/binding-conveyor-fn/fn         core.clj: 1916
                                ...                       
martinklepsch commented 9 years ago

Welcome, @mbertheau. Did you start a REPL server with something like boot repl --server before trying to connect to it with the --client invocation?

If you omit --client or --server it will implicitly do both.

Deraen commented 9 years ago

cljs-repl does call repl :server true.

mbertheau commented 9 years ago

Thank you for your help! I killed and restarted boot dev, did boot repl --client, then (start-repl) in it and after reloading the page in the browser the cljs repl was there and worked. It seems I was confused about the order in which things have to be started.

Maybe there's an issue here where after some time something is lost so that host and port are unset. When I have a way to reliably reproduce that situation, I will reopen this issue.

Thanks :)