This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-08-02
Channels
- # announcements (3)
- # aws (2)
- # babashka (60)
- # beginners (21)
- # cljs-dev (35)
- # cljsrn (3)
- # clojure (53)
- # clojure-android (2)
- # clojure-australia (3)
- # clojure-europe (45)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojurescript (33)
- # core-typed (1)
- # cursive (13)
- # datomic (6)
- # duct (1)
- # emacs (2)
- # fulcro (10)
- # introduce-yourself (3)
- # jobs (2)
- # jobs-discuss (13)
- # leiningen (1)
- # malli (19)
- # missionary (63)
- # music (1)
- # off-topic (21)
- # pathom (3)
- # polylith (18)
- # practicalli (12)
- # proletarian (1)
- # reagent (40)
- # reitit (23)
- # releases (1)
- # remote-jobs (1)
- # ring (14)
- # ring-swagger (1)
- # shadow-cljs (13)
- # sql (30)
- # testing (27)
- # tools-deps (31)
- # vim (10)
- # xtdb (4)
Forgive me if this is not the place to post troubleshooting questions about the Clojure Web online book and associated video playlist - please set me straight if so! I'm working through the excellent "https://practical.li/blog/posts/clojure-web-server-cli-tools-deps-edn/" and associated https://www.youtube.com/watch?v=SPSn02RxpxM&list=PLpr9V-R8ZxiDjyU7cQYWOEFBDR1t7t0wv&index=52. Whether from rebel readline or jacked in within Cider, I am unable to execute the functions within the simple-api-server.clj from within the namespace itself. Within the rebel readline repl I can require the simple-api-server namespace and start and stop the server that way - so the project and code does seem to be set up correctly. Not only can I not access the namespace functions from within simple-api-server namespace, I can't seem to access many of the most common clojure functions e.g. (+ 1 2 3), throwing the error "Unable to resolve symbol: + in this context". Most strangely this issue does not seem to be consistent - out of about 10 times I've tried to connect a rebel readline repl to the simple-api-server namespace I have gotten this error about 8 times, however twice or so it has worked as expected. Clearly there is something basic amiss within my setup, but I am unable to figure out where to begin troubleshooting - any help would be appreciated!
This is the right place to ask questions
So in summary, you can evaluate expressions in the Rebel repl command line. However, using Cider jack-in or connect, not even core Clojure functions evaluate.
Cider does need either a Clojure buffer or a namespace evaluated as the first thing to do after the repl has started.
As the code runs in Rebel, then if the above doesn't work, it seems likely to be an issue with the Cider install.
Although this f you did get Cider to work on occasion, it's probably due to evaluation of a Clojure buffer or ns expression. Without evaluating at least a namespace, only the 12 or so special forms work in Cider https://clojure.org/reference/special_forms
If this doesn't help, let me know. Also feel free to share any specific error messages
@U05254DQM thank you very much! Basic misunderstanding on my part - I had not evaluated the (ns ..) expression within my namespace so clojure.core functions were not getting loaded. I had assumed all functions were evaluated and available in the CIDER repl UI. Back on solid ground, thanks again!
And by the way the http://practical.li website is a phenomenal resource. I am now using practicalli/clojure-deps-edn to make the most of the community tools you have curated. I have a rough map now of the incredibly comprehensive learning ecosystem you have created and look forward to chipping away at the books and videos as I gradually become more proficient... kudos and huge thanks!
It’s a commonly missed step and I did suggest making this more obvious in the cider docs. I will check the Practicalli books and see if I can make this more obvious. I used to be caught out by this when looking for docs of functions. Even with a running REPL you have to load a buffer or namespace for docs to be found via Cider. Only the dozen special forms are present until that first evaluation
Thank you. Please let me know if there are suggestions or additional things you would like to see in any of the work. I can’t promise anything, but if I know people need something then I am more motivated to add it
I should add that this issue is not particular to this project. I started a blank project using clj-new, with the app template, and I hit the same issues.