i know this must be a question you get a lot around here, but i feel like i’m tantalizing close to getting figwheel working with nREPL.
I’m updating an older project that used to work fine with nREPL, and as the final command runs lein with-profile dev figwheel build1 build2
etc
i’ve updated all the dependencies, and currently have
:figwheel {:css-dirs ["resources/public/719998b2-df4b-4b86-9793-3f821d281369/css"]
:repl true
:readline false
:nrepl-port 7888
:nrepl-middleware ["cider.nrepl/cider-middleware"
;"refactor-nrepl.middleware/wrap-refactor"
"cider.piggieback/wrap-cljs-repl"]}
in my project.clj, where both cider.piggieback and cider-middleware are in the :profiles {:dev {:dependencies []}}
vectormy cider version in emacs is 0.21.0-SNAPSHOT
, so I’ve put that in the dependencies, along with overriding nrepl to be 0.6.0
, which I am aware may not be best practice with a shared project, but right now am concentrating on getting it working at all
I can connect to the nrepl port 7888 (although no .nrepl-port file is created so I have to type it manually)
I get as far as
user> (use 'figwheel-sidecar.repl-api)
nil
user> (cljs-repl)
Figwheel Controls:
(stop-autobuild) ;; stops Figwheel autobuilder
(start-autobuild id ...) ;; starts autobuilder focused on optional ids
(switch-to-build id ...) ;; switches autobuilder to different build
(reset-autobuild) ;; stops, cleans, and starts autobuilder
(reload-config) ;; reloads build config and resets autobuild
(build-once id ...) ;; builds source one time
(clean-builds id ..) ;; deletes compiled cljs target files
(print-config id ...) ;; prints out build configurations
(fig-status) ;; displays current state of system
(figwheel.client/set-autoload false) ;; will turn autoloading off
(figwheel.client/set-repl-pprint false) ;; will turn pretty printing off
Switch REPL build focus:
:cljs/quit ;; allows you to switch REPL to another build
Docs: (doc function-name-here)
Exit: :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application
which is all very fine, but it never connects
which I suspect is because I see exactly the same in the terminal repl
which does connect to the browser successfully
how can I get the one in the nREPL connection to work successfully?
i realise that lein repl
is the recommended way to go these days, but 1) that will probably break other people’s flows in the company and 2) i can’t get it to work anyway for the same reason (I could ignore 1. if i could just write a new script to launch the repl instead)
for what it’s worth, this is the error I have with lein repl
179 :cljsbuild {:builds {:app {:source-paths ["src/app"
^--- Map is missing required key: :cljsbuild
it would be nice to be able to check the spec manually to see if there’s something in there that’s not validating. A plain old lein new figwheel foo
works fine