nrepl / weasel

ClojureScript browser REPL using WebSockets
The Unlicense
324 stars 35 forks source link

Problem starting weasel repl #40

Closed jmckitrick closed 9 years ago

jmckitrick commented 9 years ago

Here's what I'm getting running lein trampoline repl

pts.server=> (require 'weasel.repl.websocket)
nil
pts.server=> (cemerick.piggieback/cljs-repl :repl-env (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port 9001))

IllegalStateException Can't change/establish root binding of: *cljs-repl-options* with set  clojure.lang.Var.set (Var.java:221)
tomjakubowski commented 9 years ago

This seems to happen only when lein trampoline repl is used, and it doesn't seem Weasel-specific. The same error occurs when using Piggieback with the Node.js REPL, for example:

user=> (require '[cljs.repl :as repl])
nil
user=> (require '[cljs.repl.node :as node])
nil
user=> (cemerick.piggieback/cljs-repl
  #_=>          :repl-env (node/repl-env)
  #_=>          :output-dir ".cljs_node_repl"
  #_=>          :cache-analysis true
  #_=>          :source-map true)

IllegalStateException Can't change/establish root binding of: *cljs-repl-options* with set  clojure.lang.Var.set (Var.java:221)

I don't think this is Weasel's issue.

tomjakubowski commented 9 years ago

See also https://github.com/cemerick/piggieback/issues/7#issuecomment-21796140 (edit: updated with more specific link). Maybe it's a configuration issue? I don't use lein trampoline so I'm afraid I can't be much help :smiley:

alexandergunnarson commented 9 years ago

I have this same problem and I was wondering what's causing it. I initially thought it was from lein trampoline but I tried using lein run and I had the exact same IllegalStateException. Here's my configuration:

(defproject ramsey "1.0.0-SNAPSHOT"
  :description "Clojure web app"
  :jvm-opts []
  :url "http://exampleapp.herokuapp.com"
  :license {:name "Eclipse Public License v1.0"
            :url "http://www.eclipse.org/legal/epl-v10.html"}
  :main  ramsey.web
  :dependencies
    [; CLOJURE
     [org.clojure/clojure       "1.7.0-alpha5"]
     [compojure                 "1.1.8"       ]
     [ring/ring-jetty-adapter   "1.2.2"       ]
     [environ                   "0.5.0"       ]
     ; CLOJURESCRIPT
     [org.clojure/clojurescript "0.0-2913"    ]
     [org.omcljs/om             "0.8.8"       ]
     [racehub/om-bootstrap      "0.3.1"       ]
     [sablono                   "0.2.20"      ]
     [weasel                    "0.6.0"       ]]
  :min-lein-version "2.0.0"
  :plugins
    [[environ/environ.lein "0.2.1"]
     [lein-cljsbuild       "1.0.5"]]
  :cljsbuild {
    :builds [{:id "ramsey"
              :source-paths ["src/cljs"]
              :compiler {
                :output-to "ramsey.js"
                :output-dir "out"
                :optimizations :none ; CHANGE THIS
                :source-map true}}]}
  :hooks [environ.leiningen.hooks]
  :uberjar-name "ramsey-standalone.jar"
  :profiles
    {:dev
      {:dependencies [[com.cemerick/piggieback "0.1.5"]]
       :plugins 
         [[com.cemerick/austin     "0.1.6"]
          [com.cemerick/piggieback "0.1.5"]]
       :repl-options
         {:nrepl-middleware
           [cemerick.piggieback/wrap-cljs-repl]}}
     :production {:env {:production true}}})

It may be true that this isn't Weasel's issue, as you say — so I'll post something similar on the piggieback Git repo and ask the same question.

Thanks for your help!