Fork me on GitHub
#dirac
<
2016-09-14
>
jrheard23:09:33

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

jrheard23:09:38

i'm using cursive and figwheel

darwin23:09:01

go ahead...

jrheard23:09:09

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

jrheard23:09:13

and that's been working fine

jrheard23:09:24

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

jrheard23:09:02

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

jrheard23:09:25

"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

jrheard23:09:33

but i'm kinda in over my head here

jrheard23:09:47

am i doing something completely wrong?

darwin23:09:27

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

jrheard23:09:28

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

jrheard23:09:31

good question, sec

jrheard23:09:08

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

darwin23:09:24

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

darwin23:09:37

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

darwin23:09:47

which may include some cursive stuff

jrheard23:09:08

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

darwin23:09:09

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

jrheard23:09:23

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

jrheard23:09:55

gonna reread that error message...

darwin23:09:28

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

darwin23:09:34

so we can rule cursive out

jrheard23:09:57

good idea, will do

darwin23:09:10

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

darwin23:09:33

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

jrheard23:09:20

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

jrheard23:09:44

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

jrheard23:09:03

nice, will do

darwin23:09:41

I’m going to read the article

jrheard23:09:57

thanks a ton!

jrheard23:09:30

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

darwin23:09:58

not seeing httpkit there

darwin23:09:11

try to add it to your deps: http://www.http-kit.org/

jrheard23:09:19

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

jrheard23:09:21

cool, will do

darwin23:09:11

I’m Java noob, not sure how maven works

jrheard23:09:47

i'm also a java noob 😄

jrheard23:09:49

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

jrheard23:09:59

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

jrheard23:09:14

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

jrheard23:09:24

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

jrheard23:09:30

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

darwin23:09:57

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

jrheard23:09:13

nice, hadn't seen this

darwin23:09:46

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

jrheard23:09:11

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

darwin23:09:29

I believe no

jrheard23:09:56

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

darwin23:09:14

I know, it is complex and in flux

darwin23:09:50

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

jrheard23:09:10

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

darwin23:09:24

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

jrheard23:09:39

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

jrheard23:09:47

thanks again!

darwin23:09:53

np, good luck

jrheard23:09:12

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

darwin23:09:13

you have to get nREPL + Dirac Agent running

darwin23:09:24

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

darwin23:09:37

and then "join Dirac session” in the browser

darwin23:09:56

this all has nothing to do with figwheel

jrheard23:09:06

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

darwin23:09:09

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

darwin23:09:00

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

darwin23:09:38

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

jrheard23:09:13

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:

jrheard23:09:15

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>:1:1

jrheard23:09:27

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