Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
cljs.js: require macros failure error message pertains to non-macros
{:name foo.bar, :macros true, :path "foo/bar"}
{:error #error {:message "No such namespace: foo.bar, could not locate foo/bar.cljs, foo/bar.cljc, or Closure namespace \"foo.bar\"", :data {:tag :cljs/analysis-error}}}
This patch is effectively adding an error message that would only be used by bootstrapped environments. It could be further revised so that the same error message is emitted if require-macros is called in a regular ClojureScript REPL for a unlocatable namespace. (This patch doesn't revise that behavior, which results in Clojure complaining about __init.class and clj files, but not cljc---perhaps Clojure itself in the future will be revised to mention cljc.
Repro, via
script/noderepljs
:(require 'cljs.js) (binding [cljs.js/*load-fn* (fn [x cb] (prn x) (cb nil))] (cljs.js/require 'foo.bar {:macros-ns true} prn))
this prints
{:name foo.bar, :macros true, :path "foo/bar"} {:error #error {:message "No such namespace: foo.bar, could not locate foo/bar.cljs, foo/bar.cljc, or Closure namespace \"foo.bar\"", :data {:tag :cljs/analysis-error}}}