            (when (:verbose opts)
              (debug-prn "Loading" dep))
            (require bound-vars dep opts
-             (fn [_]
-               (load-deps bound-vars ana-env lib (next deps) opts cb))))
-         (cb))))))
+             (fn [res]
+               (if-not (:error res)
+                 (load-deps bound-vars ana-env lib (next deps) opts cb)
+                 (cb res)))))
+         (cb {:value nil}))))))
+
+(declare analyze*)
 
 (defn analyze-deps
   ([bound-vars ana-env lib deps cb]

           (-> (:*cljs-dep-set* bound-vars) meta :dep-path)))
       (if (seq deps)
         (let [dep (first deps)]
           ((:*load-fn* bound-vars) {:name dep :path (ns->relpath dep)}
             (fn [resource]
               (assert (or (map? resource) (nil? resource))
                 "*load-fn* may only return a map or nil")
               (if resource
                 (let [{:keys [name lang source]} resource]
                   (condp = lang
                     :clj (analyze* bound-vars source name opts
                            (fn []
                              (analyze-deps bound-vars ana-env lib (next deps) opts cb)))
                     :js  (analyze-deps bound-vars ana-env lib (next deps) opts cb)
                     (throw
                       (js/Error.
                         (str "Invalid :lang specified " lang ", only :clj or :js allowed")))))
                 (throw
                   (ana/error ana-env
                     (ana/error-message :undeclared-ns
                       {:ns-sym dep :js-provide (name dep)})))))))
         (cb))))))

(defn load-macros [bound-vars k macros reload reloads opts cb]
  (if (seq macros)

                  (get-in reloads [k nsym])
                  (and (= nsym name) (:*reload-macros* bound-vars) :reload))]
        (require bound-vars nsym k (assoc opts :macros-ns true)
          (fn [res]
            (if-not (:error res)
              (load-macros bound-vars k (next macros) reload reloads opts cb)
              (cb res))))
        ;(intern-macros nsym k)
        ))
    (cb {:value nil})))

(defn ns-side-effects
  ([bound-vars ana-env ast opts cb]
