   [env form]
   (when-not (running? env) (throw (Exception. "Server not running")))
   (let [{session :session} @env
-        result (doall (nrepl/message session {:op "eval" :code (str form)}))]
+        {browser-repl-env :browser-repl-env} @env
+        ; result (doall (nrepl/message session {:op "eval" :code (str form)}))
+        result (cemerick.piggieback/cljs-eval browser-repl-env form :verbose true)]
     result))
 
 (defn start-browser-repl-default
   [env]
-  (let [port (:client-port env)]
-   (cljs-eval env `(do (require 'cljs.repl.browser)
-                  (cemerick.piggieback/cljs-repl
-                   :repl-env (cljs.repl.browser/repl-env :port ~port)))))
-  (swap! env #(assoc % :browser-repl-enabled true)))
+  (let [port (:client-port @env)
+        browser-repl-env (cljs.repl.browser/repl-env :port port)]
+    (cemerick.piggieback/cljs-repl :repl-env browser-repl-env)
+    (swap! env #(assoc % :browser-repl-enabled true))
+    (swap! env #(assoc % :browser-repl-env browser-repl-env))))
 
 (defn start-browser-repl
   [env]


(defn stop-browser-repl
  [env]
  (cljs-eval env :cljs/quit)
  (swap! env #(assoc % :browser-repl-enabled false)))


(defn stop

                :port port
                :handler (apply server/default-handler
                                #'cemerick.piggieback/wrap-cljs-repl
                                ; (map resolve cider.nrepl/cider-middleware)
                                server/default-middlewares))
        conn (nrepl/connect :port port)
        session (nrepl/client-session (nrepl/client conn Long/MAX_VALUE))]
    (.setReuseAddress (:server-socket server) true)
