     (first rcs)))
 
 (defn- get-deps-for-src* [state name]
-  {:pre [(compiler-state? state)
-         (string? name)]}
+  {:pre [(compiler-state? state)]}
+  (when-not (string? name)
+    (throw (ex-info (format "trying to get deps for \"%s\"" (pr-str name)) {})))
+
   (if (contains? (:deps-visited state) name)
     state
     (let [requires (get-in state [:sources name :requires])]

(defn maybe-compile-cljs
  "take current state and cljs resource to compile
   make sure you are in with-compiler-env"
  [{:keys [cache-dir cache-level] :as state} {:keys [jar file] :as src}]
  (let [cache? (and cache-dir
                    ;; i don't trust the register-constant! stuff for now
                    (not (:emit-constants state))
                    ;; even with :all only cache resources that are in jars or have a file
                    ;; cljs.user (from repl) or runtime-setup should never be cached
                    (or (and (= cache-level :all)
                             (or jar file))
                        (and (= cache-level :jars)
                             jar)))]
    (or (when cache?
          (load-cached-cljs-resource state src))
        (let [src (do-compile-cljs-resource state src)]

          :warnings warnings
          :source-map source-map)))))


;; FIXME: must manually bump if anything cache related changes
;; use something similar to clojurescript-version
(def cache-file-version "v1")

(defn get-cache-file-for-rc
  [{:keys [cache-dir] :as state} {:keys [name] :as rc}]
  (io/file cache-dir "ana" (str name "." cache-file-version ".cache.transit.json")))

(defn load-cached-cljs-resource
  [{:keys [logger cache-dir] :as state} {:keys [ns js-name name last-modified] :as rc}]
