small medium large xlarge

3469967277_7f2ef33c93_o_2_pragsmall
25 Feb 2014, 17:09
Tobias Adam (1 post)

I have trouble following the steps in Chapter 1 on page 7 (“Your first project”).

I’ve completed all the required steps (lein new compojure-app guestbook). Running the app from the console with lein ring server works. But after adding the Clojure connection in Light Table, when I evaluate the home function with Cmd-Enter Light Table takes quite some time and then it finishes with the following error message:

We couldn't connect.

Looks like there was an issue trying to connect to the project. Here's what we got:
final project:  ([org.clojure/clojure "1.5.1"] [compojure/compojure "1.1.6"] [hiccup/hiccup "1.0.4"] [ring-server/ring-server "0.3.0"] [org.clojure/tools.nrepl "0.2.3" :exclusions ([org.clojure/clojure])] [clojure-complete/clojure-complete "0.2.3" :exclusions ([org.clojure/clojure])] [ring-mock/ring-mock "0.1.5"] [ring/ring-devel "1.2.0"] [lein-light-nrepl/lein-light-nrepl "0.0.15"] [org.clojure/tools.reader "0.8.3"])
Error loading lighttable.nrepl.handler: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context, compiling:(cljs/analyzer.clj:1498:11)
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context, compiling:(/private/var/folders/c7/l5r144y52cb2b_sqstlzr6kw0000gn/T/form-init6100153706891867644.clj:1:3781)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6567)
	at clojure.lang.Compiler.analyze(Compiler.java:6361)
	at clojure.lang.Compiler.analyze(Compiler.java:6322)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
	at clojure.lang.Compiler.analyze(Compiler.java:6361)
	at clojure.lang.Compiler.analyze(Compiler.java:6322)
	at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3624)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6562)
	at clojure.lang.Compiler.analyze(Compiler.java:6361)
	at clojure.lang.Compiler.access$100(Compiler.java:37)
	at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:5973)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
	at clojure.lang.Compiler.analyze(Compiler.java:6361)
	at clojure.lang.Compiler.analyze(Compiler.java:6322)
	at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5708)
	at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5139)
	at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3751)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6558)
	at clojure.lang.Compiler.analyze(Compiler.java:6361)
	at clojure.lang.Compiler.eval(Compiler.java:6616)
	at clojure.lang.Compiler.eval(Compiler.java:6609)
	at clojure.lang.Compiler.load(Compiler.java:7064)
	at clojure.lang.Compiler.loadFile(Compiler.java:7020)
	at clojure.main$load_script.invoke(main.clj:294)
	at clojure.main$init_opt.invoke(main.clj:299)
	at clojure.main$initialize.invoke(main.clj:327)
	at clojure.main$null_opt.invoke(main.clj:362)
	at clojure.main$main.doInvoke(main.clj:440)
	at clojure.lang.RestFn.invoke(RestFn.java:421)
	at clojure.lang.Var.invoke(Var.java:419)
	at clojure.lang.AFn.applyToHelper(AFn.java:163)
	at clojure.lang.Var.applyTo(Var.java:532)
	at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException: Unable to resolve var: lighttable.nrepl.handler/lighttable-ops in this context
	at clojure.lang.Util.runtimeException(Util.java:219)
	at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:650)
	at clojure.lang.Compiler.analyzeSeq(Compiler.java:6560)
	... 33 more
clojure.lang.ExceptionInfo: Subprocess failed {:exit-code 1}
	at clojure.core$ex_info.invoke(core.clj:4327)
	at leiningen.core.eval$fn__2081.invoke(eval.clj:226)
	at clojure.lang.MultiFn.invoke(MultiFn.java:231)
	at leiningen.core.eval$eval_in_project.invoke(eval.clj:326)
	at clojure.lang.AFn.applyToHelper(AFn.java:167)
	at clojure.lang.AFn.applyTo(AFn.java:151)
	at clojure.core$apply.invoke(core.clj:619)
	at leiningen.repl$repl.doInvoke(repl.clj:253)
	at clojure.lang.RestFn.invoke(RestFn.java:425)
	at leiningen.light_nrepl$light.doInvoke(light_nrepl.clj:56)
	at clojure.lang.RestFn.invoke(RestFn.java:423)
	at leiningen.light_nrepl$_main.doInvoke(light_nrepl.clj:68)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:159)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at leiningen.light_nrepl.main(Unknown Source)

I’m running the examples on Mac OS X 10.9.1 and installed Leiningen via Homebrew.

  • Leiningen Version: Leiningen 2.3.4 on Java 1.6.0_65 Java HotSpot(TM) 64-Bit Server VM
  • Light Table version: 0.6.4
  • Light Table Binary version: 0.8.4

Can anybody explain what is going wrong?

Profile_pic_pragsmall
01 Mar 2014, 14:50
Dmitri Sotnikov (47 posts)

It appears that a few people experienced this problem and there’s an issue thread on GitHub regarding it. The issue is now closed, but It might be worth reopening it as it doesn’t seem to be resolved.

Generic-user-small
20 Mar 2014, 19:14
Derek Groothuis (1 post)

FYI, since it wasn’t cross-referenced here - doing a lein clean in my project directory seemed to resolve the issue for me, per Dmitri’s suggestion here: http://pragprog.com/titles/dswdcloj/errata

Generic-user-small
01 Apr 2014, 23:37
Tim McCoy (1 post)

I was experiencing the same error. Doing a lein clean in my project directory worked for me too. Leiningen 2.3.4 on Java 1.8.0 Java HotSpot(TM) 64-Bit Server VM System Version: OS X 10.9.2 (13C64) Kernel Version: Darwin 13.1.0

Person_photo_pragsmall
15 Apr 2014, 02:09
Bruno Kim Medeiros Cesar (4 posts)

I solved it editing the project.clj. Replace

[compojure “1.1.6”]

with

[compojure “1.1.6” :exclusions [org.clojure/tools.reader]]

and add to the :dependencies list

[org.clojure/tools.reader “0.7.10”]

The reason seems to be that LightTable expects this version of tools.reader, but Compojure brings in version 0.7.3 . You may see a project’s dependency tree running

lein deps tree

Pasfoto3_pragsmall
18 May 2014, 14:42
Marten Sytema (2 posts)

the lein clean fixed it for me too.

  You must be logged in to comment