Fork me on GitHub
#cursive
<
2017-02-21
>
cjmurphy03:02:22

"No modules containing clojure.main" <- I used to be able to create a local REPL easily but now get this. Is there a solution?

cjmurphy03:02:00

If I go to the project structure I can see that there's a module there. But I can't select it when trying to create a local REPL configuration.

cjmurphy03:02:27

Perhaps there's something I need to change in the project.clj?

cjmurphy03:02:42

I registered the lein project, which I thought might help. However the suggested stub generation crashes.

cjmurphy03:02:48

I invalidated caches and restarted, but still get the stub generation crashing. The exact message is "Error generating stubs for module demo".

moizsj08:02:53

does anyone here use Cursive with CLJS+Figwheel+Reagent? if yes, howz your experience been? maybe @timothypratley ?

cfleming09:02:36

@cjmurphy So, two problems - the modules containing clojure.main issue is usually when you’re trying to use a module that doesn’t have Clojure itself as a dependency.

cfleming09:02:40

Could you check that?

cfleming09:02:36

The stub problem would hopefully be fixed in the dev build, see: https://clojurians-log.clojureverse.org/cursive/2017-02-16.html

cfleming09:02:08

@moizsj Yes, I used that when building the licence renewal page.

cfleming09:02:14

It worked nicely!

cfleming09:02:27

I didn’t often bother with a REPL, but figwheel was great.

moizsj09:02:15

good to know Colin! @cfleming

cjmurphy11:02:48

@cfleming: The first issue ("No modules containing clojure.main") fixed itself when I registered the lein project, as was suggested when I looked at the project.clj file. I'm going off an Untangled project, so the dependencies from project.clj should all be fine. Untangled developers all use IDEA/Cursive, so it should be pretty quick to get any project going. Perhaps the generating stubs problem is from more recent Cursives, and they are all on an older version.

cjmurphy11:02:09

@cfleming: 'Figwheel configuration error' that 'The required key :cljsbuild is missing'. But :cljsbuild is there in the project.clj <-- that's why the stubs are not generated - I can see from the log. So perhaps not a Cursive problem really.

cjmurphy11:02:55

Actually it all seems to be fine just using lein from the command line, so perhaps it is a Cursive problem after all.

timothypratley14:02:00

@moizsj it works great 🙂 Having arity checking etc in Cursive is very helpful, and navigation etc work well.

cfleming19:02:03

@cjmurphy Did you try the dev build for the :cljsbuild problem?

cfleming19:02:24

@cjmurphy Actually @wilkerlucio had the same problem. I believe it’s fixed now in the dev build, but Slack has eaten the discussion I had with him around it. Let me know if that doesn’t fix the problem.

cjmurphy20:02:44

@cfleming: My particular problem was known by Untangled folks. This was the bad line: (def figwheel-config (fig/fetch-config)). Doing too much in a def, and building the stubs causes the defs to be run.

grav21:02:55

@moizsj I'm using Cursive + Figwheel + Reagent daily, and it works quite well!

cfleming22:02:37

@cjmurphy Ahhhh.... I remember now 🙂

cjmurphy22:02:30

I'm working with an IDEA project that has many project.clj within it. I know how to get the IDE to ask me to register a particular project.clj. After it has done that everything seems to be concentrated on that project.clj. Is there an easy way to unregister a project.clj? That way I will be able to switch between working with different project.clj.

cjmurphy23:02:43

I've realised you can register many. And that this IDEA project has many project.cljs with the same name! Them having the same name seems to stuff Cursive about so I can fix that...

cfleming23:02:36

@cjmurphy Hmm, why do your projects all have the same name?

cfleming23:02:10

I’m not sure how well Cursive would handle that - by name I guess you mean the lein artifact name?

cjmurphy23:02:18

I'm just going off an existing IDEA project i.e. not one I created. But am fixing it now.

cfleming23:02:15

You can definitely create a project with multiple lein projects, see: https://cursive-ide.com/userguide/leiningen.html under “Working with multi-module projects"

cjmurphy23:02:36

defproject untangled/demo "1.0.0" <-- they all (actually most) say demo, but I'm changing them.

cfleming23:02:00

I see. I think that should work, but I’m not sure I’ve ever tested it.

cjmurphy23:02:44

Its a 'cookbook' - so lots of separate project.clj files. I'll fix then see if I can work with one, then another. Thanks for the doc reference.