Fork me on GitHub
Timofey Sitnikov11:12:32

Good Morning Clojurians, When I try to follow:, and and execute:

[I] /home/sporty/clojure/fulcro/app1~> npx shadow-cljs server
shadow-cljs - config: /home/sporty/clojure/fulcro/app1/shadow-cljs.edn
shadow-cljs - starting via "clojure"
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.11.8 running at 
shadow-cljs - nREPL server started on port 9000
I am trying to connect to it with, the vim-iced, requires execution of $ iced repl {YOUR-BUILD-ID} command. What is the {YOUR-BUILD-ID}?


@timofey.sitnikov according to It should be :main i think. Its the key that you have used in the :builds key in shadow-cljs.edn

Timofey Sitnikov12:12:32

I tried this:

[I] /home/sporty/clojure/fulcro/app1~> iced repl :main
OK: CLJS option is enabled.
OK: Clojure CLI project is detected
Execution error (FileNotFoundException) at (
:main (No such file or directory)

Full report at:
Content of the /tmp/clojure-12744298337363785468.edn report:
 "Execution error (FileNotFoundException) at (\n:main (No such file or directory)\n",
  :clojure.error/line -2,
  :clojure.error/cause ":main (No such file or directory)",
  :clojure.error/source "",
  :clojure.error/phase :execution},
    :message ":main (No such file or directory)",
    :at [ open0 "" -2]}],
  [[ open0 "" -2]
   [ open "" 219]
   [ <init> "" 157]
   [ <init> "" 112]
   [clojure.lang.Compiler loadFile "" 7571]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$script_opt invokeStatic "main.clj" 535]
   [clojure.main$script_opt invoke "main.clj" 530]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "" 137]
   [clojure.lang.Var applyTo "" 705]
   [clojure.main main "" 40]],
  :cause ":main (No such file or directory)"}}
Among others, I also tried:
$ iced repl main


Right so this took a bit of figuring out as Im not very familiar with the cljs ecosystem 😕 - Use iced repl instead of passing the build id to start the repl - Open the browser on localhost:8000 or the port you configured in shadow-cljs.edn - Then inside vim, go to your cljs file and run the vim command: :IcedConnect it should prompt for the repl type, choose shadow-cljs - Then run the vim command :IcedStartCljsRepl shadow-cljs main to start the repl


Im quite sure there's a better way/im missing something 😕


Maybe @UBL24PLE6 knows better?

Timofey Sitnikov12:12:48

Tried it, but it looks like the iced repl does launch a REPL but it does not launch the server on the localhost:8000. I will try to require the source into the namesapce, enter namespace and launch the server manually?


@timofey.sitnikov It should be main as a {YOUR-BUILD-ID} > OK: Clojure CLI project is detected It seems deps.edn is detected (higher priority than shadow-cljs.edn), so you should also use --force-shadow-cljs option.

Timofey Sitnikov13:12:25

OK, so I run the command:

[I] /home/sporty/clojure/fulcro/app1~> iced repl --force-shadow-cljs main
OK: CLJS option is enabled.
OK: shadow-cljs project is detected
OK: For shadow-cljs project, start watching instead of starting REPL.
shadow-cljs - config: /home/sporty/clojure/fulcro/app1/shadow-cljs.edn
shadow-cljs - connected to server
shadow-cljs - watching build :main
[:main] Configuring build.
[:main] Compiling ...
[:main] Build completed. (251 files, 1 compiled, 1 warnings, 3.10s)
Everything still works in browsers, but when I am back in vim and i type: :IcedConnect, I get this:
iced-nrepl is not enabled. Please launch repl with `iced repl` command.

Timofey Sitnikov13:12:17

Interesting, when I execute :IcedConnect second time, I get Already Connected. The I can execute: IcedEval (+1 2) and I get 3, but when I execute :IcedEval (js/alret "Hi") I get No such namespace: js


Do you have .nrepl.edn or $HOME/.nrepl/nrepl.edn? iced is created automatically if these are absent, but if they are present, the contents have not been confirmed so far. So could you add middleware setting as follows?


Maybe you are in CLJ session instead of CLJS session becase of the middleware missing error.

Timofey Sitnikov13:12:10

Wow, I was not even close. I did not have the .nrepl.edn, even worse, I did not have the middleware dependencies that supposed to be in the shadow-cljs.edn. When I do place them in the shadow-cljs.edn , I get :

WARNING: The configured :dependencies in shadow-cljs.edn were ignored!
         When using :deps they must be configured in deps.edn
So somehow I have to place it into deps.edn.

Timofey Sitnikov14:12:12

OK, that solved it! deps.edn needs the nrepl dependencieds, like this:

:aliases {:dev {:extra-paths ["src/dev"]
                 :extra-deps  {org.clojure/clojurescript     {:mvn/version "1.10.742"}
                               thheller/shadow-cljs          {:mvn/version "2.11.8"}
                               binaryage/devtools            {:mvn/version "0.9.10"}
                               refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
                               cider/cider-nrepl             {:mvn/version "0.25.5"}
                               iced-nrepl/iced-nrepl         {:mvn/version "1.1.1"}}}}}

Timofey Sitnikov14:12:59

Thank you so much.

Timofey Sitnikov14:12:03

I am just a beginner, cljs supposed to be simple and easy, and it is, if you know all of the details.

Timofey Sitnikov12:12:18

I did bunch of research on this and decided to make notes for myself:

Tim Robinson19:12:37

hi all - a very simple question: when I do an eval with fireplace that prints to standard output, I'm not seeing the output anywhere in vim or in my "lein repl" window. Is there a way to see it?

Jan K19:12:20

For me println output shows directly in vim. My only idea is check if you're using cider-nrepl in your lein profile/plugins + make sure you're using latest everything

Tim Robinson21:12:52

hmm thanks. pretty sure I'm using the latest everything but I'm on Windows so maybe that's the difference.