New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get nil error when integrate with other framework like Luminus #13
Comments
it seams that shadow-build will seek all the cljs dependencies in current project, and get some unexcept error. to avoid of this, i have to setup other project to generate the js script and out to my Luminus project resource folder. |
It seems like a macro namespace is not found. Which either means the macro file is not on the classpath or does not exist at all. Do you have macros (.clj files) that are not on the classpath? shadow-build does not manage the classpath so you might have to add the source-path in leiningen. |
I just pushed a new update that throws a proper error when a macro is not found, should be easier to track down the missing macro then.
|
i used Cider find that which namespace cause the url to nil -> Find cljs resources in jars name: quiescent/dom.clj url: nil case the error, and i finally found that it was [prone "0.8.0"](A Better exception reporting middleware for Ring) introduce the dependency of [quiescent "0.1.4"] thanks a lot. now i take careful of the dependency, cause the problem. now i put every cljs dependency under the :dev tag |
I just looked at prone. It ships with a whole lot of external javascript, the cljs.core.async source for example. But it only ships with the .cljs sources (not the macros) which causes a bunch of errors. Opened magnars/prone#21 as I think that should be cleaned up, I imagine this causes a lot of "hidden" issues for other people. |
(defn discover-macros [state]
595 ;; build {macro-ns #{used-by-source-by-name ...}}
596 (let [macro-info (->> (:sources state)
597 (vals)
598 (filter #(seq (:macros %)))
599 (reduce (ƒ [macro-info {:keys [macros name]}]
600 (reduce (ƒ [macro-info macro-ns]
601 (update-in macro-info [macro-ns] set-conj name))
602 macro-info
603 macros))
604 {})
605 (map (ƒ [[macro-ns used-by]]
606 (let [name (str (ns->path macro-ns) ".clj")
607 url (io/resource name)]
608 {:ns macro-ns
609 :used-by used-by
610 :name name
611 :url url})))
612 (map (ƒ [{:keys [url] :as info}]
613 (when url
614 (if (not= "file" (.getProtocol url))
615 info
616 (let [file (io/file (.getPath url))]
617 (assoc info
618 :file file
619 :last-modified (.lastModified file)))))
620 ))
621 (map (juxt :name identity))
622 (into {}))]
623 (assoc state :macros macro-info)
624 ))
add line no 613 can fixed the problem
The text was updated successfully, but these errors were encountered: