Fork me on GitHub
#cider
<
2017-01-04
>
richiardiandrea01:01:48

how was the trick to make my buffer a clojurescript one?

richiardiandrea01:01:41

I get the dreaded ...needs a ClojureScript REPL. If you don't know.... on cider 0.14.0

chris_johnson04:01:04

@richiardiandrea That means youโ€™re trying to evaluate a Clojurescript statement in the Clojure REPL - you need to start a CLJS REPL, either with M-x cider-jack-in-clojurescript or by e.g. (cljs.repl/repl (cljs.repl.node/repl-env)) in your Clojure REPL

richiardiandrea04:01:55

Yep I have done the second, but in boot, I thought there was a way to mark it ๐Ÿ˜

chris_johnson04:01:54

cider just knows hehe

richiardiandrea04:01:15

I tried clojurescript-mode with no luck ..Anyway thanks

dpsutton12:01:25

cider "knows" because the repl receives stuff back from a cljs backend. when status comes back, it mentions cljs

dpsutton12:01:56

as far as I'm aware, you evaluate things in "java" clojure code that invokes clojurescript middleware

dpsutton12:01:07

for lein, this is done automatically and configured by you

dpsutton12:01:16

but in boot, you have to setup your own task that does this

dpsutton12:01:03

(deftask dev []
  (comp (watch)
        (cljs-repl) ; order is important!!
        (cljs)))

mitchelkuijpers15:01:58

@richiardiandrea there is also cider-create-sibling-cljs-repl which you can configure yourself to run the command you would like, I use this to run (start-repl) with boot after I started my dev task in my clojure-repl

mitchelkuijpers15:01:54

if you also use projectile you can even vary this command per project with a .dir-locals.el file per project

richiardiandrea16:01:11

@dpsutton yep I do that already, still you need to call start-repl...Even after that I cannot evaluate code in the buffer

dpsutton16:01:29

you invoked your task that invokes (cljs-repl)?

richiardiandrea16:01:30

I will try to investigate today

dpsutton16:01:58

and what happens after you do that?

richiardiandrea16:01:03

You need task + invoke a function

richiardiandrea16:01:27

After that I get to the cljs.user prompd

dpsutton16:01:41

turn on toggling of the messaging

richiardiandrea16:01:43

But every eval command gives me that error

dpsutton16:01:47

nrepl-toggle...

dpsutton16:01:04

and see if it sent back a status of "done" that also includes a repl type of "cljs"

dpsutton16:01:31

you should see a session id of your clojure repl and then hopefully see a new session id for the clojurescript backend

dpsutton16:01:51

> but every eval command gives me that error which error?

richiardiandrea16:01:01

Ok thanks for the details I will check in a bit (on the bus to work now)

dpsutton16:01:17

is this by chance a cljc buffer?

dpsutton16:01:03

if you want to send me a link to a repo that can easily demonstrate the bug i'll look at it tonight

richiardiandrea16:01:11

Ok Yes I have a repo, it is a bit hacky as I am porting figwheel to boot but it should work anyways

richiardiandrea16:01:18

To be in the same situation you should grab the fighweel branch here: https://github.com/boot-clj/boot-figreload

richiardiandrea16:01:11

If it's too much work don't worry I will be checking that during the day

richiardiandrea16:01:44

One thing is that if I copy and paste the form the repl (of course) works

richiardiandrea17:01:09

@dpsutton it looks ok in the project above so I might actually need to try another demo project

dpsutton17:01:17

so its working for you now?

dpsutton17:01:25

yeah, see that "repl-type" "cljs"

dpsutton17:01:37

that's what cider remembers and when its looking for a clojure script repl it goes on that value

dpsutton17:01:41

so if you see that you should be good

richiardiandrea17:01:16

mmm I don't know yet, let me try the other prj, but thanks I did not know that and now my debug can be more focused ๐Ÿ˜‰

dpsutton17:01:49

hahaa didn'tknow there was a CIDER emoji

richiardiandrea17:01:22

just found it ๐Ÿ™‚

richiardiandrea18:01:21

@dpsutton the problem solved by itself, magically

richiardiandrea20:01:18

by the way it has to do with the execution/connection order

richiardiandrea20:01:55

I have to launch boot, then connect to nrepl, then ((eval 'adzerk.boot-cljs-repl/start-repl)) in the repl buffer, then connect the browser to localhost:PORT

bhagany20:01:03

thatโ€ฆ nearly makes sense to me

richiardiandrea20:01:56

no yeah definitely makes sense ๐Ÿ˜ง

richiardiandrea20:01:20

just that after a couple of months of not using it, I probably forgot ๐Ÿ˜„

clodeindustrie22:01:47

Iโ€™m trying to debug a web app but Iโ€™m not sure how to go about connecting to the running webserver

clodeindustrie22:01:22

I usually run it with a boot task, I thought I would be able to connect to it through cider-jack-in

clodeindustrie22:01:41

but it spins up its own nrepl

clodeindustrie22:01:03

is cider-connect and loading the app env myself my only option ?

seancorfield22:01:48

If your web app starts its own nREPL server, then you can cider-connect to it and it will have the app env already set up.

clodeindustrie22:01:16

oh right I thought I would have to load the env myself