Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Precompile issue #25

Open
boymaas opened this issue Jan 18, 2014 · 4 comments
Open

Precompile issue #25

boymaas opened this issue Jan 18, 2014 · 4 comments

Comments

@boymaas
Copy link

boymaas commented Jan 18, 2014

Hello there, was integrating stefon in my project and got this strange error on running precompile:

java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to java.lang.CharSequence
at clojure.string$split.invoke(string.clj:222)
at leiningen.stefon_precompile$split_ns.invoke(stefon_precompile.clj:9)
at leiningen.stefon_precompile$stefon_precompile.invoke(stefon_precompile.clj:16)
at clojure.lang.Var.invoke(Var.java:415)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$resolve_task$fn__3029.doInvoke(main.clj:189)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.lang.AFunction$1.doInvoke(AFunction.java:29)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:619)
at leiningen.core.main$apply_task.invoke(main.clj:230)
at leiningen.core.main$resolve_and_apply.invoke(main.clj:234)
at leiningen.core.main$_main$fn__3092.invoke(main.clj:303)
at leiningen.core.main$_main.doInvoke(main.clj:290)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:415)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.core$apply.invoke(core.clj:617)
at clojure.main$main_opt.invoke(main.clj:335)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at clojure.lang.Var.invoke(Var.java:423)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)

My settings are as follows:

:stefon-options {
:mode :production
:asset-roots ["resources"]
:serving-root "resources/public/assets"
:manifest-file "resources/manifest.json"
:precompiles ["resources/assets/app.js.stefon"]
}

Tried solving the problem myself by looking at the code, I am seeing a str/split on an namespace on a return on (:stefon-options project). Since I have no experience with lein and their plugin structure I could not figure it out. Maybe I am just doing something wrong. Help would be appreciated! :-)

@pbiggar
Copy link
Contributor

pbiggar commented Jan 18, 2014

I think the problem is that stefon expects to see a string representing a namespace in project.clj's stefon-options, not a map with options.

If we can make that clearer in the README, would love a PR to that effect!

@boymaas
Copy link
Author

boymaas commented Jan 18, 2014

Yes, I thought something like that also, but what namespace? If i look at the example project, which is based on an earlier version I just see key, values. I'll try to figure it out, production is still a few months ahead, it will probably be resolved by that time ;-)

@dwwoelfel
Copy link
Contributor

@boymaas it wants you to def your options in a namespace, then provide the namespace-qualified symbol as a string in your project.clj. It looks like this:

myproject/src/stefon.clj:

(ns myproject.stefon)

(def stefon-options
  {:mode :production
   :asset-roots ["resources"]
   ...})

project.clj:

(defproject myproject ...
  ...
  :stefon-options "myproject.stefon/stefon-options"
  ...)

Does that make sense?

@boymaas
Copy link
Author

boymaas commented Jan 21, 2014

@dwwoelfel yes!! That makes sense! Thank you for the time to explain this :-) Gonna run with it immediatly ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants