Search code examples
clojureleiningenlighttable

Failing to connect to compojure-app with LightTable


I just ran "lein new compojure-app guestbook" following the book "Web Development with Clojure". In one step the book is connecting to my Clojure project with light table. However when I try this I get the following error that makes no sense to me.

Here is the error I'm getting


Solution

  • Your Error

    For the search engines, here is a copy of the pertinent part of your error:

    Error loading lighttable.nrepl.handler: java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context
    

    The Cause

    Lighttable has upgraded to using a newer tools.reader.

    I found two resources:

    1. An applicable github issue that you might find helpful.
    2. A forum thread covering the question (mentioned in the github issue above).

    The Summarized Solution

    Several people have solved this by simply running lein clean in their project directory.

    If lein clean does not solve it for you, then here is the extended solution from the forum:

    In 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

    After employing this solution, you may wish to run lein clean again.