This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-29
Channels
- # admin-announcements (1)
- # aws (10)
- # beginners (76)
- # boot (53)
- # braid-chat (1)
- # cider (80)
- # cljs-edn (3)
- # clojure (65)
- # clojure-belgium (2)
- # clojure-gamedev (2)
- # clojure-nl (3)
- # clojure-poland (1)
- # clojure-russia (39)
- # clojure-uk (14)
- # clojurescript (91)
- # cursive (62)
- # datascript (1)
- # datomic (9)
- # dirac (34)
- # emacs (25)
- # error-message-catalog (8)
- # events (1)
- # hoplon (88)
- # instaparse (1)
- # jobs (2)
- # jobs-discuss (6)
- # lein-figwheel (7)
- # luminus (43)
- # mount (5)
- # off-topic (7)
- # om (28)
- # onyx (61)
- # planck (4)
- # re-frame (27)
- # reagent (3)
- # remote-jobs (2)
- # spacemacs (3)
- # untangled (136)
Hey cider loving folks, I just started to switch away from intellij towards spacemacs. So far so good. But I am running into an issue after running cider-jack-in-clojurescript
I am connecting to a chrome extension. And so figwheel needs this option: :figwheel {:websocket-url "
@bbss have a look here https://github.com/bhauman/lein-figwheel/wiki/Using-the-Figwheel-REPL-within-NRepl#integration-with-emacscider
Yeah I think somehow the :figwheel option in [:cljsbuild :builds] build object is not being passed.
ok but if it works from there then your configuration isn't the problem, just making sure it's specific to cider
So now I've been able to start those two nREPL's using cider-jack-in-clojurescript
, my web-app connects but I can't evaluate (js/console.log "ello")
in the repl, and evaluating using C-c C-e
tells me:
user-error: `cider-eval-last-sexp' needs a ClojureScript REPL.
If you don't know what that means, you probably need to jack-in (`C-c M-J')
I am typing that in the repl yes, I get an error, that evaluating C-c C-e was in the code file
probably does have something to do with the figwheel setup, I'm using that snippet that's also in the wiki
ok, so here's one problem: M-: (cider-current-connection "cljs")
on a .cljs source file buffer should return a connection, but it returns nil
(mapcar 'cider--connection-type (cider-find-connection-buffer-for-project-directory
nil :all-connections))
;;=> ("clj" "clj")
Not that it is very helpful but cursive is also first a clj repl before it properly boots.
weird thing is, in the cljs (supposed) repl I get
;; You can disable it from appearing on start by setting
;; `cider-repl-display-help-banner' to nil.
;; ======================================================================
user> Figwheel: Starting server at
nil
;; You can remove this message with the ‘cider-repl-clear-help-banner’ command.
;; You can disable it from appearing on start by setting
;; ‘cider-repl-display-help-banner’ to nil.
;; ======================================================================
user> Figwheel: Starting server at
Figwheel: Watching build - app
Compiling "resources/public/js/compiled/lambdaisland.js" from ["src"]...
Successfully compiled "resources/public/js/compiled/lambdaisland.js" in 1.535 seconds.
Figwheel: Starting CSS Watcher for paths ["resources/public/css"]
Launching ClojureScript REPL for build: app
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
Switch REPL build focus:
:cljs/quit ;; allows you to switch REPL to another build
Docs: (doc function-name-here)
Exit: Control+C or :cljs/quit
Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application
To quit, type: :cljs/quit
nil
cljs.user>
I would do a cider-quit
, then lein clean
to make sure you have no old build artifacts getting in the way, then try lein figwheel
to see if figwheel is happy building your project
I'll open an issue about the REPL type, looking at cider-nrepl it seems it only takes piggieback-based repls into account, and I believe the Figwheel REPL isn't based on piggieback
there's ansi-term
which mostly behaves like a regular terminal, and there's eshell
which is a shell implemented in elisp
it can get messy with keybindings, especially with command line apps that do their own input handling. And also things that use a lot of escape codes like ncurses based apps will look a bit weird
hmmm I may be wrong, to use figwheel with nrepl you should be using piggieback, in which case cider should detect it
and indeed, once figwheel has connected and you see cljs.user>
the repl type is correctly set to "cljs"
. If you try to evaluate before that you will get the "needs a ClojureScript REPL" error
The problem I had is that I didn't have my cljs code in my top-level :source-path
and my :test-path
; I had it in a :dev
profile
CIDER is sensitive to this; if it can't figure out the file you are clojurescript source in one of those paths specified at the top on leiningen then cider-jack-in-clojurescript
has the behavior you are describing
I have some feature ideas which I would love to cider have. Anybody can recommend a starting point to contribute with cider?
also, you can open an issue on the issue tracker to discuss your issue, hear feedback, possible implementations, get collaborations, etc
would probably involve hacking around with https://github.com/clojure/tools.trace