I'm trying to figure out how to get a proper clojurescript repl running in Cursive using piggieback. But I can't get it to work. I've followed the advise on https://whynotsoftware.github.io/Migrating-From-Lein-Figwheel-To-Figwheel-Main/
I get this error message
Execution error (ExceptionInfo) at figwheel.main/nrepl-repl (main.cljc:1527). Failed to launch Figwheel CLJS REPL: nREPL connection found but unable to load piggieback. This is commonly caused by A) not providing piggieback as a dependency and/or B) not adding piggieback middleware into your nrepl middleware chain. Please see the documentation for piggieback here https://github.com/clojure-emacs/piggieback#installation Note: Cider will inject this config into your project.clj. This can cause confusion when your are not using Cider.
I have included [cider/piggieback "0.5.0"]
as a dev dependency, [cider/cider-nrepl "0.25.2"]
as a plugin and added :nrepl-middleware [cider.piggieback/wrap-cljs-repl]
to :repl-options
Anyone have an idea?
@brjann how did you start your repl?
This is an existing server-side project that I've added cljs to. So I alredy have a nREPL running that I access as a remote REPL using the run command.
It is from this repl that i tried to run (require '[figwheel.main.api :as f]) (f/start {:mode :serve} "dev") (f/cljs-repl "dev")
The last command fails
TBH I don't really understand what I am doing. For the minute I start figwheel from the terminal using lein fig -- --build dev --repl
you need to follow the instructions as provided in that article
The migrating article?
yes
it uses lein repl
to start nREPL
which includes the piggiback middleware
Oh, and the cursive repl does not?
apparently not?
I guess not...
you should also change the :init
to you startup code for figwheel
Ok, now I have it running in the terminal! But can I add it "within" Cursive, with syntax highlighting and stuff?
Oh wait
It works!
However, it's not using the figwheel config that I intended. In my figwheel-main.edn i have :watch-dirs ["src/cljs" "src/cljc" "test/cljs"]
and :open-url false
, which works fine when I run lein fig -- --build dev --repl
But (f/start {:mode :serve} "dev")
gives this output
user=> (f/start {:mode :serve} "dev") [Figwheel] Validating figwheel-main.edn [Figwheel] figwheel-main.edn is valid \(ツ)/ [Figwheel] Compiling build dev to "target/public/js/main.js" [Figwheel] Successfully compiled build dev to "target/public/js/main.js" in 4.967 seconds. [Figwheel] Outputting main file: target/public/js/main-auto-testing.js [Figwheel] Watching paths: ("src/cljs") to compile build - dev [Figwheel] Starting Server at http://localhost:9500 Opening URL http://localhost:9500
So it's not watching the right directories and opens the URL. What am I missing?
Also, the port should be 2020, not 9500
Oh, maybe {:mode :serve}
replaces the figwheel-main.edn?
Hello everyone, I'm running on windows10 (therefore, Leiningen) and trying to connect to the NodeJS reply, using the devtools. The REPL setup works fine for the browser build, however it seems I'm making some mistake with the NodeJS repl config. Here's my setup
I'd be happy to test things out wrt windows and update the docs as indicated here https://github.com/bhauman/figwheel-main/issues/250
@bhauman: I got it working now. You were right, follow the instructions... Thank you!
@abhi18av yes I will definitely take a PR if you figure this out
I’m not on windows so … it’s tough for me, I’m always looking for folks to take on windows support
@bhauman - Cool 👍 Just to confirm, did you notice anything odd in the config at all?
I've tried the lein fig:nodejs
on the terminal as well - no luck
Is there any example, gist I could take a hint from?