ah, it works for dependencies in both, it's just my project's namespaces that I can't seem to require
@jbaiter: have you resolved that require problem? I believe this is nREPL thing, dirac just uses standard nREPL connection
nope, i haven't 😕
the standard figwheel cljs repl doesn't use nrepl, right?
not by default
you can enable it and try it there
add :nrepl-port 7777
that i will do, thank you!
and connect to it from Cursive or some other nREPL-enabled client
lein repl
can also connect and act as nREPL client
see lein help repl
ah, i have that already enabled
but when I connect to the port I get a standard clojure/jvm repl
hmm, figwheel has some docs how to enter cljs repl via nREPL I think
(use 'figwheel-sidecar.repl-api)
and `(start-figwheel!)
(use 'figwheel-sidecar.repl-api)
and (start-figwheel!)
yup, that launches the regular figwheel repl that you get with lein figwheel
, though
but maybe this is not what we want, we should try to start standard piggieback
right
i think for nrepl in clojurescript I need piggieback
but dirac uses a custom forked version, i think
ok, then follow piggieback + weasel docs
will do :simple_smile:
yes, dirac uses slightly modified piggieback, but features were added, not removed 😉
thanks for the work, btw, i *really* appreciate dirac and the custom formatters
thanks
the thing is I don’t fully understand this nREPL/piggieback stuff 😞
reading piggieback and clojurescript core REPL sources is hard for me
hehe, i'm with you
i find getting to grips with all of the tooling the hardest part about clojure/cljs
indeed, unfortunately I don’t see an easy way to fix this problem :simple_smile: too many moving parts and we are building on top of “foreign” platforms
whole lein/boot stuff has java legacy, and cljs stuff must respect underlying javascript ecosystem
it is nice when it works, but when something breaks in the platform below, it is too hard for most people to deal with it
precisely, leaky abstractions all over
same with error messages
it's really a testament to the language that i enjoy it as much as i do .)
well, some class of error messages is fixable (language-level errors/warnings)
some class of runtime errors from underlying platform is not fixable IMO
i think i'll leave that piggieback stuff be for tonight, ClassNotFoundException
for piggieback, even though its in my classpath and in the dependencies
did you add it to :nrepl-middleware?
yep, tried it both in symbolic and string form, both times class not found
it's in :dependencies
, too
hm, weird
do you use lein? what lein pprint
says?
https://gist.github.com/jbaiter/68edf92fa69f2b89e5ac#file-project-clj-L101
pprint is not a task 😅
ah, add lein-pprint plugin
I have it in ~/.lein/profiles.clj
we want to see lein with-profile project/dev pprint :dependencies
wonder why you are adding [org.clojure/clojurescript "1.7.228”] into :plugins, that cannot work
tbh, most of the stuff in there is from the luminus template
piggieback is in there, when i run the command
so that ClassNotFoundException is raised from some init code? what if you try to require it directly from repl
I think (require ‘cemerick.piggieback)
hah, that works
so it is on class path, some code somewhere is trying to require something and raises ClassNotFoundException, can you investigate what code is responsible for it?
i think it's the anonymous function bound to start-repl
when i add the require
to the init
code it works
comment out that whole :init stuff in :repl-options
i copy-pastaed the code from the sample repository
and do it by hand
when your repl starts, boot your cljs.repl one command a time
(require 'cemerick.piggieback) (require 'weasel.repl.websocket) (cemerick.piggieback/cljs-repl (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port 9001))
line-by-line
we will see where is the problem
IllegalStateException Can't change/establish root binding of: *cljs-repl-env*
3rd line?
yep, on the third line
wait a sec, I have figwheel running in the baackground, maybe that has something to do with it
mh, nope
wait I’ve seen this error before
I cannot recall when and where 😉
ah, it was clojure version
let’s see
that lein pprint command, what clojure version it displayed?
1.8.0
I see that you have 1.8.0, but it could be overriden by something else I guess
ok
that’s right
i found some issues on github, but those refer to piggieback 0.1
hah
ah, no
i thought i had an indentation error and :repl-options ended up inside of :cljjsbuild
but that was not the case
try to add [org.clojure/tools.nrepl "0.2.12”] into deps
ah, you have it there
try to comment out :main from the project.clj, line #44
nope
i'm afraid i have to call it a day now 😕
thanks for the help!
ok, good night
maybe a set of fresh eyes tomorrow morning will bring the solution .)
I think you will have to start commenting out pieces of that project.clj, it is pretty complex
yeah, that is an excellent idea
or maybe write a minimal one from scratch, just for repl
gn
you too!
and let us know how it went :simple_smile:
will do!