Fork me on GitHub
#cider
<
2020-01-22
>
dpsutton00:01:52

I think it’s important to have the test namespaces evaled?

dominicm07:01:33

I would guess that your tests folder isn't on the classpath

oliver13:01:41

Hi everyone, I'm trying to set up shadow-cljs with CIDER. I've cloned the official demo repo from https://github.com/minimal-xyz/minimal-shadow-cljs-browser. I can successfully run the following from the command line: shadow-cljs compile app shadow-cljs cljs-repl app shadow-cljs watch app According to the Docs (https://docs.cider.mx/cider/cljs/shadow-cljs.html, (https://shadow-cljs.github.io/docs/UsersGuide.html#cider) CIDER should work with shadow-cljs out of the box. However, when I run cider-jack-in-cljs I first get asked Are you sure you want to run 'cider-jack-in' without a Clojure project? Then, after specifying shadow as REPL type and :app as the build I get the following: error in process filter: user-error: ClojureScript is not available. then I drop into a pure Clojure-REPL with no CLJS. Info on this Error is scarce (see here e.g. https://clojurians-log.clojureverse.org/cider/2018-05-26), it's likely a Classpath error of some kind. (I'm running Java 1.8.0_232, Clojure 1.10.1. Emacs 26.3 and CIDER 20200120.711.) I'm probably missing something obious here, just taking my first step with shadow-cljs (@dpsutton, you may have guessed that I'm following your suggestion to resconstruct the macchiato template in shadow-cljs) Many thanks for any ideas you may share on this problem!

dpsutton13:01:16

@services what’s your CIDER version. From memory, it’s been a while since support for shadow was added

papachan13:01:27

@services thats weird it works fine for me. i have this version You could just build a new project from scratch with this template? lein new shadow-cljs <your-project-name> +reagent or npx create-cljs-project [project-name]

oliver14:01:32

Ok, I've tried with the template suggested by @papachan … same result. Also I've replaced my previous version of CIDER (most recent from MELPA, 20200120.711) with the current version from MELPA-stable, which is 0.23.0… no change

Eric Ihli14:01:57

Are you running cider-jack-in-cljs in an emacs buffer of a file that is inside the repository? You can't run the command from a scratch buffer etc...

oliver14:01:04

That I know, I've tried running it from the shadow-cljs.edn buffer and from one of the .cljs-files under src

dpsutton14:01:30

can you update your clojure-mode?

oliver14:01:51

I am troubled however by the question Are you sure you want to run 'cider-jack-in' without a Clojure project?

oliver14:01:15

Never got that using Boot or Leinigen

Eric Ihli14:01:27

You can also do a debug-on-entry on cider--update-jack-in-cmd and then run cider-jack-in-cljs and step through and see if you notice anything funny. Like, you should probably have a (:project-dir "~/.../minimal-shadow-cljs-browser/") entry in the param plist. If not, trace it back to figure out why.

dpsutton14:01:45

i think clojure-mode is responsible for the project root. So if it doesn't speak shadow then a newer version will

oliver14:01:58

@dpsutton, You got it! Turned out my clojure-mode was 20171008.743… back from when I tookmy first stab at Clojure…

oliver14:01:30

…it works now … I'm wondering what other pains finding this earlier would have saved me from

oliver14:01:05

Many thanks to all of you… that was really swift!

oliver14:01:19

Ona side note: I'm a bit surprised that CIDER didn't complain about this upon install… clojure-mode is a dependency after all…

dpsutton14:01:08

i think emacs works like that. it only ensures a dependency is satisfied, not its version unfortunately

dpsutton15:01:59

but glad you're up and running! cider

oliver15:01:34

So am I, thanks again for your help… when it works CIDER gives me the best tooling eperience I've ever had!

parens 4
oliver17:01:11

@dpsutton, just for closure (no pun intended): I have now successfully ported the Macchiato template to shadow-cljs. Except for some streamlining left to be done CIDER integration works like a breeze… At some point it might make sense to share this as an alternative on clj-templates… for now: Many thanks for your help in the process!