oakes/play-cljc

lein repl failing in project

kovasap opened this issue · 4 comments

Hi! I'm brand new to clojure (but not coding) and am excited to start messing around with this library! I've started setting up my vim to use vim-fireplace to help with completion/goto capabilities, but ran into an issue when running lein repl in the root of my play-cljc project. Everywhere else, this command runs correctly, but I get the following error when running in my play-cljc:

Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
Compilation failed: Subprocess failed

Is this expected? Is there another way I could set up a repl in my project that could interface with vim-fireplace? Does the clj -A:dev dev.clj command do this already?

oakes commented

You can start up a REPL with clj -A:dev:macos (use :windows or :linux instead depending on your OS). Although there is a project.clj file, lein won't actually work; the project is set up for using the clj tool instead.

ok cool! for reference, the following worked for me to set up an nREPL to connect to vim-fireplace:

clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline -A:dev:linux

Is it possible to use this setup with the version of the game that runs in the browser? It's super cool that I can change things and see them change as I mess around with the browser version. Or can I run a native version and have this repl interact with it?

oakes commented

I'm not sure how to make vim connect to a figwheel REPL but you should definitely be able to at least run the game from the clojure REPL. Once you connect to it from vim, you need to go into the start-dev namespace with something like (doto 'hello-world.start-dev require in-ns) and then run (start). Then you should see a window pop up with your game.

Ok cool that worked! Again for reference, I did:

clj -A:dev:linux -m nrepl.cmdline

After adding:

        nrepl/nrepl {:mvn/version "0.5.3"}

to deps.edn. I did this last part because I was having issues with orchestra not being on the classpath, and I figured that the -Sdeps flag in my earlier command may be overriding the deps.edn dependencies.