Fork me on GitHub
#clojurescript
<
2022-07-17
>
István Karaszi14:07:46

shadow-cljs reload issue

István Karaszi14:07:59

hi everybody, I started to work on a hobby project

István Karaszi14:07:17

and I thought I’ll try to solve it in clojurescript

István Karaszi14:07:41

I started with deps.edn but when I needed to add npm dependencies I quickly realized that it is not really working, so I switched to shadow-cljs

István Karaszi14:07:03

the reloading worked with the standard clojure repl with deps.edn but with shadow-cljs for some reason it does not

István Karaszi14:07:12

I am using the node-repl

István Karaszi14:07:25

and the way I am trying to reload my namespace:

(require 'announcement-notifier.parser :reload)

István Karaszi14:07:36

but the reloading simply does not work

István Karaszi14:07:46

this would be a CLI application

István Karaszi14:07:36

I guess I am doing something wrong, even though I was following the user guide (but that is 4 years old, so I guess it could be outdated)

thheller14:07:04

> but the reloading simply does not work

thheller14:07:10

what does that mean?

thheller14:07:34

it crashes? shows errors? melts your CPU? shuts down your computer? 😉

István Karaszi14:07:01

nope, it evaluates the previous version all the time

István Karaszi14:07:44

I change something in the namespace, but I need to restart the whole repl to see the results

thheller14:07:07

dunno. it should work fine but haven't tried it in forever. most editors issue a load-file request and :reload is rarely used

István Karaszi14:07:04

I am using doom-emacs but the cider has other issues 🙂

thheller14:07:11

did you actually save the file before the require? and maybe give it a sec or so? could be that just the file on disk isn't updated before the require tries to read it?

István Karaszi14:07:03

that is a usual mistake, yes. 🙂 but I did

István Karaszi14:07:34

cider says the following error BTW:

WARNING: CIDER requires cider-nrepl to be fully functional. Some features will not be available without it! (More information)
WARNING: clj-refactor and refactor-nrepl are out of sync.
Their versions are 3.5.2 and n/a, respectively.
You can mute this warning by changing cljr-suppress-middleware-warnings.Execution error (ExceptionInfo) at shadow.cljs.devtools.server.nrepl/shadow-cljs-repl (nrepl.clj:33).
shadow-cljs nREPL initialization failure!
Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.
Instead got a #cljs.repl.node.NodeEnv{:host "localhost", :port 49500, :path nil, :socket #object[clojure.lang.Atom 0x36bfdec3 {:status :ready, :val nil}], :proc #object[clojure.lang.Atom 0x67298a26 {:status :ready, :val nil}], :state #object[clojure.lang.Atom 0x1a203ab9 {:status :ready, :val {:listeners 0}}], :debug-port nil}

István Karaszi14:07:18

and also a different error in the cider-error buffer:

clojure.lang.ExceptionInfo: shadow-cljs nREPL initialization failure!
Your nREPL client sent a wrong parameter. A keyword specifying the build-id is expected.
Instead got a #cljs.repl.node.NodeEnv{:host "localhost", :port 49500, :path nil, :socket #object[clojure.lang.Atom 0x36bfdec3 {:status :ready, :val nil}], :proc #object[clojure.lang.Atom 0x67298a26 {:status :ready, :val nil}], :state #object[clojure.lang.Atom 0x1a203ab9 {:status :ready, :val {:listeners 0}}], :debug-port nil}
{}

thheller14:07:13

can't comment on cider config issues but you need to configure it to use shadow-cljs

thheller14:07:25

the above shows that it isn't properly configured

thheller14:07:34

cannot tell you how to configure it since I don't use emacs

István Karaszi14:07:07

thanks, that is fine. if the REPL would start working that would be enough for me

thheller14:07:48

feel free to open an issue with exact steps to reproduce. can't look into it right now and will forget otherwise

István Karaszi14:07:14

I’ll try to create a super-simple repro repo then

István Karaszi14:07:28

thank you anyways

thheller14:07:38

steps are fine, should be easy enough to replicate but sure repo helps

István Karaszi14:07:07

thank you, will do!

István Karaszi18:07:15

should I create a shadow-cljs issue on GitHub?

István Karaszi18:07:59

oh, I just realized that you mentioned this already

Kannan Ramamoorthy18:07:12

Team, I'm practicing CLJS. And stuck in using antd react component. Posted my question https://stackoverflow.com/questions/73014241/converting-antd-formitem-to-reagent-hiccup. Any help along wtih rationale would be helpful.

Kannan Ramamoorthy19:07:05

Thanks a lot for taking time @U2FRKM4TW. Seems like that's still not working. Replied to your comment.

3starblaze15:07:45

I checked the issue because I have used antd with reagent and as @U2FRKM4TW mentioned, it's very likely that the importing is the issue. If you are importing Icon from antd then I believe you are passing wrong params to it. Check out https://ant.design/components/icon/#Custom-SVG-Icon