Giter Club home page Giter Club logo

Comments (2)

dqdinh avatar dqdinh commented on July 19, 2024

I had the following bug below while using doo and figwheel.

 $ lein clean; lein figwheel 
java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Named
 at clojure.core$name.invoke (core.clj:1524)
    clojure.lang.AFn.applyToHelper (AFn.java:154)
    clojure.lang.AFn.applyTo (AFn.java:144)
    ...

After several hours of leiningen config trial and error, it turns out that Figwheel will specifically error out if it sees :main 'app.core. Options 2 and 3 will work.

It might help prevent others from spending time debugging if the :main 'app.core in the README and example config was changed to Option 2 or 3. The error only occurs when specifying :main 'app.core inside :cljsbuild {:builds {:build-id {:compiler ...} and calling lein figwheel. All other cljsbuild commands work.

This is my current working project.clj for reference.

(defproject frontend "0.1.0"
  :dependencies [[org.clojure/clojure "1.7.0"]
                 [org.clojure/clojurescript "1.7.48"]
                 [reagent "0.5.1-rc3"]
                 [re-frame "0.4.1"]
                 [environ "1.0.0"]
                 [prismatic/schema "1.0.1"]
                 [prismatic/plumbing "0.4.4"]
                 [figwheel "0.4.0"]
                 [cljs-ajax "0.3.14"]]

  :plugins [[lein-environ "1.0.0"]
            [lein-figwheel "0.4.0"]
            [lein-cljsbuild "1.0.6"]
            [lein-doo "0.1.5-SNAPSHOT"]
            [codox "0.8.13"]]

  :source-paths ["src"]

  :codox {:language :clojurescript
          :exclude clojure.string}

  :profiles {:dev {:env {:dev? true
                                    :cors? true}

                           :cljsbuild {:builds {:client {:figwheel {:on-jsload "frontend.core/mount-root"}
                                                                   :compiler {:main "frontend.core"
                                                                        :source-map true
                                                                        :source-map-timestamp true
                                                                        :optimizations :none
                                                                        :output-dir "resources/public/js/out"
                                                                        :asset-path "js/out"}}}}}}

  :clean-targets ^{:protect false} [:target-path
                                    :compile-path
                                    "resources/public/js"
                                    "../public/frontend-dev"
                                    "../public/frontend-prod"]

  :cljsbuild {:builds {:client {:source-paths ["src"]
                             :compiler {:output-to "resources/public/js/main.js"}}

                       :browser-test {:source-paths ["src" "test"]
                                      :compiler {:output-to "resources/public/js/browser_tests.js"
                                                 :main "frontendtest.browser"
                                                 :optimizations :none}}}}

  :figwheel {:css-dirs ["resource/public/css"]
             :server-port 3333
             :repl false})

from doo.

flosell avatar flosell commented on July 19, 2024

+1 to changing the examples in README.md to something like :main "example.runner", would have saved me half an hour of debugging and googling.

@bensu: Any doubts?

from doo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.