dirac 2016-09-14

hi - i'm trying to set up dirac for my project, and am having a difficult time

i'm using cursive and figwheel

i followed the instructions in https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL to get figwheel+cursive to play together

and that's been working fine

but when i apply this diff to my project.clj: http://pastebin.com/NsF4RSR6

i get this error message when trying to start my app via cursive: http://pastebin.com/2AbcdtDU

"Could not locate org/httpkit/server__init.class or org/httpkit/server.clj on classpath., compiling:(figwheel_sidecar/components/figwheel_server.clj:1:1)" is probably the relevant bit

but i'm kinda in over my head here

am i doing something completely wrong?

"trying to start my app via cursive” and idea what exact lein command it is issuing?

the rest of the project.clj is here, if that's helpful: https://github.com/jrheard/voke/blob/ai/project.clj

good question, sec

i'm not sure actually, will dig around a bit

this looks to me that some dependencies clashed, we could investigate it via lein deps :tree

but you would have to run it in the same context like cursive does

which may include some cursive stuff

if i'm interpreting this right, i think cursive doesn't use leiningen here, and instead runs https://github.com/jrheard/voke/blob/ai/script/repl.clj directly

I’ve seen cursive “injecting” crazy stuff, to do REPL completions and similar

i've got it set up to do that as per that figwheel wiki page i linked earlier

gonna reread that error message...

next step would be to run the script from command-line without cursive and reproducing the same error

so we can rule cursive out

good idea, will do

I’m not sure how that script gets classpath setup, is it something cursive figures out from project.clj on its own?

if cursive does some classpath magic, we won’t be able to reproduce it easily from command-line

unclear - here's what the configuration UI for this looks like, again as per that wiki page: https://www.evernote.com/shard/s11/sh/c6f6f7bf-4b07-44fb-9751-231d3f8a7634/6edb409220d70bf2

maybe i should be asking this in #cursive instead? unclear if this is dirac's fault or not

nice, will do

I’m going to read the article

thanks a ton!

adding a few more printlns to see what specific line's falling over

not seeing httpkit there

looks like it's the first line, (use 'figwheel-sidecar.repl-api)

cool, will do

I’m Java noob, not sure how maven works

i'm also a java noob 😄

adding http-kit to my deps seems to have solved the problem!

i'll poke around and try to understand why that's necessary

i think there's a chance my machine's in a bad state, dropbox got mad a few days ago and modified / rolled back a bunch of my files

i'll nuke this dir from orbit and try messing with a clean checkout

thanks for your help! looking forward to using your tool! 😄

maybe now we should ask question why you need this setup in the first place, if you wan to work with dirac under cursive, you should follow: https://github.com/binaryage/dirac/blob/master/docs/integration.md

nice, hadn't seen this

I use figwheel only for hot-reloading, and I leave REPL functionality to Dirac

yeah, that's what i want as well - do i not need the stuff from that figwheel wiki page any more?

at what point does figwheel's auto-reloading get set up, then? my mental model around all of these tools is extremely hazy

I know, it is complex and in flux

hot-reloading is basic feature (I don’t know if it can be disabled)

cool, i'll poke around and see what works / see if i can figure out how all this fits together

all the REPL stuff is just extra stuff, which can be disabled, you did that by :repl false

that integration.md looks very useful, and i'm not seeing a giant stacktrace any more, so i'm happy 😄

thanks again!

yup, was working through that when i ran into this stack trace

you have to get nREPL + Dirac Agent running

then you can try to connect Cursive to the same nREPL server

and then "join Dirac session” in the browser

this all has nothing to do with figwheel

gotcha - so i'll start by just using lein repl from the command-line, and will deal with cursive integration once i'm done with installation.md

it is orthogonal (assuming figwheels REPL/nREPL is disabled)

that :repl-options config applies to your nREPL server launched by lein repl

not sure if cursive can see it and make sense of it, I don’t think so, you just configure cursive’s nREPL client via UI dialog

ok, so i've followed the instructions in installation.md, and lein repl gives encouraging-looking output (connected to nrepl server, agent is accepting connections) - but when i load up my app via chrome canary and click on the dirac button, i see:

Dirac requires runtime support from your app. Please install Dirac Runtime into your app and enable the :repl feature. ReferenceError: dirac is not defined at <anonymous>11

my project.clj looks like this - have i done something wrong? https://github.com/jrheard/voke/blob/ai/project.clj#L36