Fork me on GitHub
Tomas Brejla11:07:37

Hello. There was this question in #shadow-cljs: and someone replied that it might be better to ask here in #cider. I'm not sure, whether the question fits more into cider, shadow, or even some other place, so sorry if it's not cider-related. Any idea if those NPM JS modules' exports can get offered by cider? If so, what's needed to make that working? Or does anything needs to be developed first (eg. some sort of middleware)? If so, what and where?

đź‘Ť 3

I'm not really deep in this, but if you want to dig into the nuts and bolts of it you'd probably look at clj-suitable


When I start shadow-cljs with cider, I see the following error:

Execution error (AssertionError) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:30).
Assert failed: (keyword? repl-env)
What is this error and how do I fix it?


(from the shadow-cljs side it is telling you that you called the function incorrectly, don't know how you called it though)


I'm trying to achieve something like this in Emacs to bind system-setup-stuff to keys etc:

(let ((b (cider-scratch--create-buffer)))
  (with-current-buffer b
    (insert "(prn \"side effect some stuff\")")
    (goto-char (point-max))
without the massive stupidity of this approach ... in particular, I'd like to set a namespace too and all I've been thinking of using nREPL directly for this, but I figured there must be a smarter way to do it and hoped someone here could give me a nudge


@ps can you try m-x nrepl-toggle-message-logging and then try it again? It should create a buffer that has all nrepl traffic so you can see what's going back and forth. Also, can you give us the steps you are taking? ie, cider-jack-in-cljs choose shadow and then choose a build?


yeah when I choose shadow everything works, including 8081, but when I choose browser I was getting that error


what is "choose shadow" and "choose browser"?


your shadow-cljs.edn file doesn't list those as builds:

{:nrepl {:port 7002}
               {:target     :browser
                :output-dir "target/cljsbuild/public/js"
                :asset-path "/js"
                :modules    {:app {:entries []}}
                :devtools   {:watch-dir "resources/public"
                             :preloads  [re-frisk.preload]}
                :dev        {:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}}
                :release    {}}
         :test {:target  :browser-test
                :test-dir "target/test/"
                :autorun true
                :devtools {:http-port 8081
                           :http-root "target/test/"}}}
 :lein  true}


need to be precise so i know what you are choosing


during cider startup there’s an option to choose browser, figwheel, shadow, figwheel-main etc.


always choose shadow


when you are using shadow


after choosing shadow, there’s an option to either choose :test, :app, :browser-repl or :node-repl. :browser-repl and :node-repl don’t make sense to me, so I choose one of the other two. But emacs doesn’t let me jack-in-cljs twice so I can’t choose both :test and :app simultaneously. How to run them simultaneously?


browser-repl and node-repl are built in helpful tools of shadow. the other two are your builds


ignore the simultaneous problem for now. do both profiles work individually?


but I need it simultaneous because it takes very long to start and stop the repls


ok so your question is not about what build to choose or anything else, it's about running two simultaneous cljs repls?


both of your builds work correctly


error in process sentinel. shadow-cljs server already running