Boot qestion

Hello,

I did start-repl and want to keep the repl session open. How to do it?
currently if inactive for a some minutes, it gets disconnected.

Appreciated.

sun

You’ll need to provide more information for anyone to help you.

What do you mean by “start-repl”?

Are you doing this at the command-line, or via some editor? (which O/S, which editor, what Clojure-plugin?)

Please describe your setup in more detail.

I used Boot for three years and never heard of a REPL just closing due to inactivity.

Here is more detail.
The flatform is mac.
I did boot dev on one terminal to start the app.

Once the app starts up, I did boot repl -c on another terminal to get boot.user=> prompt.

At the prompt I typed in (start-repl).

The problem is that the ws connection becomes unresponsive

$ boot repl -c

Classpath conflict: org.clojure/clojure version 1.10.0 already loaded, NOT loading version 1.7.0

REPL-y 0.4.3, nREPL 0.6.0

Clojure 1.10.0

Java HotSpot™ 64-Bit Server VM 1.8.0_65-b17

    Exit: Control+D or (exit) or (quit)

Commands: (user/help)

    Docs: (doc function-name-here)

          (find-doc "part-of-name-here")

Find by Name: (find-name “part-of-name-here”)

  Source: (source function-name-here)

 Javadoc: (javadoc java-object-or-class-here)

Examples from [clojuredocs.org](http://clojuredocs.org): [clojuredocs or cdoc]

          (user/clojuredocs name-here)

          (user/clojuredocs "ns-here" "name-here")

boot.user=> (start-repl)

<< started Weasel server on ws://127.0.0.1:54401 >>

<< waiting for client to connect … Connection is ws://localhost:54401

Writing boot_cljs_repl.cljs…

connected! >>

To quit, type: :cljs/quit

nil

cljs.user=>

ex1=> (my-reload a-items)

#object[ex1.a_items]

ex1=> (my-reload a-items)

#object[ReferenceError ReferenceError: ex1 is not defined]

ReferenceError: ex1 is not defined

at eval (eval at <anonymous> ([http://localhost:3017/js/app.out/weasel/repl.js:30:494](http://localhost:3017/js/app.out/weasel/repl.js:30:494)), <anonymous>:1:69)

at eval (eval at <anonymous> ([http://localhost:3017/js/app.out/weasel/repl.js:30:494](http://localhost:3017/js/app.out/weasel/repl.js:30:494)), <anonymous>:9:3)

at [http://localhost:3017/js/app.out/weasel/repl.js:30:494](http://localhost:3017/js/app.out/weasel/repl.js:30:494)

at [http://localhost:3017/js/app.out/weasel/repl.js:39:4](http://localhost:3017/js/app.out/weasel/repl.js:39:4)

at Object.G__12816__2 ([http://localhost:3017/js/app.out/cljs/core.js:35676:106](http://localhost:3017/js/app.out/cljs/core.js:35676:106))

at Object.G__12816 [as call] ([http://localhost:3017/js/app.out/cljs/core.js:35943:20](http://localhost:3017/js/app.out/cljs/core.js:35943:20))

at goog.net.WebSocket.<anonymous> ([http://localhost:3017/js/app.out/weasel/repl.js:187:71](http://localhost:3017/js/app.out/weasel/repl.js:187:71))

at goog.net.WebSocket.goog.events.EventTarget.fireListeners ([http://localhost:3017/js/app.out/goog/events/eventtarget.js:284:23](http://localhost:3017/js/app.out/goog/events/eventtarget.js:284:23))

at Function.goog.events.EventTarget.dispatchEventInternal_ ([http://localhost:3017/js/app.out/goog/events/eventtarget.js:381:26](http://localhost:3017/js/app.out/goog/events/eventtarget.js:381:26))

at goog.net.WebSocket.goog.events.EventTarget.dispatchEvent ([http://localhost:3017/js/app.out/goog/events/eventtarget.js:196:34](http://localhost:3017/js/app.out/goog/events/eventtarget.js:196:34))

Also here is my build.boot file:

(set-env!

:source-paths #{“src/cljs”}

:resource-paths #{“resources”}

:dependencies '[

             [adzerk/boot-cljs   "2.1.5"]

             [adzerk/boot-reload "0.6.0"]

             [pandeiro/boot-http "0.8.3"] 

             ; REPL 

             [adzerk/boot-cljs-repl   "0.4.0"] ;; latest release

             ;[com.cemerick/piggieback "0.2.1"  :scope "test"]

             [cider/piggieback "0.4.2"]

             [weasel "0.7.0"]

             [org.clojure/tools.nrepl "0.2.13"]

             ; clojurescript and reagent

            [org.clojure/clojurescript "1.10.597"]        

            [reagent "0.9.0-rc4"]

            

             [reagent-utils "0.3.3"]

             ; failed [bidi "2.1.6"] ; 

             [bidi "2.1.5"] ; [bidi "2.0.0"]

             [venantius/accountant "0.2.5"]

             [metosin/reitit "0.4.2"]  ; use reitit

            ])

(require

'[adzerk.boot-cljs :refer [cljs]]

'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]]

'[adzerk.boot-reload :refer [reload]]

'[pandeiro.boot-http :refer [serve]])

(deftask build

(comp (speak)

    (cljs)))

(deftask run

;(comp (serve)

(comp (serve :port 3017)

    (watch)

    (cljs-repl)

    (reload)

    (build)))

(deftask production

(task-options! cljs {:optimizations :advanced})

identity)

(deftask development

(task-options! cljs {:optimizations :none :source-map true}

             reload {:on-jsload 'chapter01.app/init})

identity)

(deftask dev

“Simple alias to run application in development mode”

(comp (development)

    (run)))

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.