Fork me on GitHub
#cider
<
2021-07-08
>
Tomas Brejla11:07:37

Hello. There was this question in #shadow-cljs: https://clojurians.slack.com/archives/C6N245JGG/p1625656017490600 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
Schmoho19:07:00

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

zendevil19:07:06

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?

thheller19:07:49

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

Schmoho19:07:45

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))
    (cider-eval-last-sexp)))
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

dpsutton19:07:27

@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?

zendevil19:07:07

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

dpsutton19:07:37

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

dpsutton19:07:07

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

{:nrepl {:port 7002}
 :builds
        {:app
               {: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}

dpsutton19:07:14

need to be precise so i know what you are choosing

zendevil19:07:19

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

dpsutton20:07:07

always choose shadow

dpsutton20:07:13

when you are using shadow

zendevil20:07:59

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?

dpsutton20:07:56

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

dpsutton20:07:10

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

zendevil20:07:02

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

dpsutton20:07:12

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

dpsutton20:07:25

both of your builds work correctly

zendevil20:07:33

error in process sentinel. shadow-cljs server already running