bhauman / figwheel-main

Figwheel Main provides tooling for developing ClojureScript applications
https://figwheel.org
Eclipse Public License 1.0
640 stars 93 forks source link

Configuration error in CLJS compile options: dev.cljs.edn #256

Closed prasoon2211 closed 4 years ago

prasoon2211 commented 4 years ago

Hi, I made a basic reagent template by following https://rigsomelight.com/figwheel-main-template/

Running lein fig:build works no problem (hot reloading, repl -> browser connection all work)

Then, I followed this guide to install an npm library: https://figwheel.org/docs/npm.html

Now, when I run lein fig:build, I get the following error:

2020-07-15 12:36:08.586:INFO::main: Logging initialized @4006ms to org.eclipse.jetty.util.log.StdErrLog
Configuration error in CLJS compile options: dev.cljs.edn
-- Spec failed --------------------

  {:main ..., :target :bundle, :bundle-cmd ...}
                      ^^^^^^^

should be one of: :nodejs, :webworker

-- Doc for :target -----

  If targeting nodejs add this line. Takes no other options at the
  moment. The default (no :target specified) implies browsers are being
  targeted. Have a look here for more information on how to run your
  code in nodejs.

    :target :nodejs

-------------------------
Detected 1 error

My project.clj

(defproject weather-app "0.1.0-SNAPSHOT"
  :description "FIXME: write this!"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :min-lein-version "2.7.1"

  :dependencies [[org.clojure/clojure "1.9.0"]
                 [org.clojure/clojurescript "1.10.520"]
                 [reagent "0.8.1"]]

  :source-paths ["src"]

  :aliases {"fig"       ["trampoline" "run" "-m" "figwheel.main"]
            "fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]
            "fig:min"   ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]
            "fig:test"  ["run" "-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "weather-app.test-runner"]}

  :profiles {:dev {:dependencies [[com.bhauman/figwheel-main "0.2.3"]
                                  [com.bhauman/rebel-readline-cljs "0.1.4"]]
                   }})

My dev.cljs.edn:

^{:watch-dirs ["test" "src"]
  :css-dirs ["resources/public/css"]
  :auto-testing true}
{:main weather-app.core
 :target :bundle
 :bundle-cmd {:none ["npx" "webpack" "--mode=development" :output-to "-o" :final-output-to]}}

Thanks.

prasoon2211 commented 4 years ago

I got a reply on Clojurians slack saying the versions of CLJS and figwheel-main are both old versions. I'll try with newer versions and report back. Until then, closing the ticket.