cider

A channel dedicated to the Clojure Interactive Development Environment that Rocks (aka CIDER). :cider:
tomd 2021-03-17T18:18:50.005500Z

Hi 👋 recently I've started having trouble calling cider-repl-set-ns successfully for cljs namespaces. I get

WARNING: Use of undeclared Var cljs.user/in-ns at line 1 <cljs repl>
and
#object[TypeError: Cannot read property 'call' of undefined]
         (<NO_SOURCE_FILE>)
but calling (in-ns 'whatever-namespace) always succeeds. how can I go about fixing this? I'm guessing it should be calling cljs.core/in-ns instead? I haven't changed cider version recently. Stuck on v0.25.0. Thanks for any help

bozhidar 2021-03-18T09:01:55.007800Z

Merged. 🙂

🙏 1
tomd 2021-03-17T18:29:04.005600Z

just noticed that setting cider-repl-require-ns-on-set to t was causing this. when set back to nil, i'm not getting this behaviour. apologies if this has been fixed since v0.25.0. If someone can verify it's broken in master, I'll gladly make a github issue.

bozhidar 2021-03-17T20:14:28.005900Z

The behavior is still the same, although I can't imagine how you'd be getting this error, unless cljs.core is not required for some reason.

tomd 2021-03-17T21:26:59.006100Z

I guess the require isn't working as expected in cljs 🤷 - I'll make an issue. May find some time to see if I can replicate in a more vanilla clj/cljs setup. Cheers

thheller 2021-03-17T21:31:55.006300Z

require and in-ns are special forms in the CLJS REPL so they don't work when wrapped in some other form or so

👍 1
thheller 2021-03-17T21:32:26.006500Z

(do (in-ns 'foo.bar) (require 'foo.bar)) for example wouldn't work

tomd 2021-03-17T21:35:05.006700Z

ah! that's great to know, thanks!

tomd 2021-03-17T21:35:15.006900Z

I reckon I could do a PR for this

tomd 2021-03-17T22:21:22.007100Z

submitted.

👍 1