diff --git a/src/main/clojure/cljs/analyzer.cljc b/src/main/clojure/cljs/analyzer.cljc index e340827e3a..cc83885201 100644 --- a/src/main/clojure/cljs/analyzer.cljc +++ b/src/main/clojure/cljs/analyzer.cljc @@ -109,10 +109,11 @@ (str "Use of undeclared Var " (:prefix info) "/" (:suffix info))) (defmethod error-message :undeclared-ns - [warning-type {:keys [ns-sym] :as info}] + [warning-type {:keys [ns-sym js-provide] :as info}] (str "No such namespace: " ns-sym ", could not locate " (util/ns->relpath ns-sym :cljs) - " or " (util/ns->relpath ns-sym :cljc))) + ", " (util/ns->relpath ns-sym :cljc) + ", or Closure namespace \"" js-provide "\"")) (defmethod error-message :dynamic [warning-type info] @@ -1290,7 +1291,7 @@ (analyze-file src opts) (throw (error env - (error-message :undeclared-ns {:ns-sym dep})))))))))) + (error-message :undeclared-ns {:ns-sym dep :js-provide (name dep)})))))))))) (defn check-uses [uses env] (doseq [[sym lib] uses] diff --git a/src/main/clojure/cljs/closure.clj b/src/main/clojure/cljs/closure.clj index e3e5489106..f1609fae03 100644 --- a/src/main/clojure/cljs/closure.clj +++ b/src/main/clojure/cljs/closure.clj @@ -518,11 +518,13 @@ (let [relpath (str path ".cljc")] (if-let [cljc-res (io/resource relpath)] {:relative-path relpath :uri cljc-res} - (let [relpath (:file (get-in @compiler-env [:js-dependency-index (str ns)]))] + (let [ijs (get-in @compiler-env [:js-dependency-index (str ns)]) + relpath (or (:file ijs) (:url ijs))] (if-let [js-res (and relpath ;; try to parse URL, otherwise just return local ;; resource - (or (try (URL. relpath) (catch Throwable t)) + (or (and (util/url? relpath) relpath) + (try (URL. relpath) (catch Throwable t)) (io/resource relpath)))] {:relative-path relpath :uri js-res} (throw