Search code examples
clojurescriptfigwheel

'figwheel' is not a task


I was happily using figwheel all day. I terminated the process by entering :cljs/quit.

When I try to restart figwheel lein figwheel, I'm greeted with this message from leiningen:

'figwheel' is not a task. See 'lein help'

Running lein help lists many tasks I can perform, but figwheel is not among them.

Here's what my project.clj looks like (extra stuff elided):

(defproject myproject
 ...
:dependencies [...]
:plugins [[lein-environ "1.0.2"]
          [lein-cljsbuild "1.1.1"]
          [lein-asset-minifier "0.2.4"]]
...
:profiles {:dev {:dependencies [...
                                [lein-figwheel "0.5.0-6"]
                                ...]
                 :plugins [[lein-figwheel "0.5.0-6"]
                           ...]
                 :figwheel {...}}}
 ...)

Here's what I've tried so far:

  • Verified I was in the correct directory
  • Checked out all code changes made since the last successful figwheel start
  • Added [lein-figwheel "0.5.0-6"] to the base :plugins vector (this sort of worked, but didn't recognize any of my profile-specific settings)
  • Restarted my computer

Solution

  • You can type lein help profiles to read all about profiles. The problem in this case is caused by:

    Remember that if a profile with the same name is specified in multiple locations, only the profile with the highest "priority" is picked – no merging is done. The "priority" is – from highest to lowest – profiles.clj, project.clj, user-wide profiles, and finally system-wide profiles.

    It's using the :dev in profiles.clj which doesn't have figwheel. This is also why adding lein-figwheel to the base :plugins sort of helped, but doesn't use all your settings.

    There's a straightforward solution suggested by the docs:

    If you need to enable personal overrides of parts of a profile, you can use a composite profile with common and personal parts - something like :dev [:dev-common :dev-overrides]; you would then have just :dev-overrides {} in project.clj and override it in profiles.clj.