     
     ;; compile, flush, reload, repeat
     (loop [state state]
-      (recur (-> state
-                 (cljs/step-compile-modules)
-                 (cljs/flush-to-disk)
-                 (cljs/flush-unoptimized)
-                 (cljs/wait-and-reload!)
-                 ))))
+      (let [new-state (try
+                        (-> state
+                            (cljs/step-compile-modules)
+                            (cljs/flush-unoptimized)
+                            (cljs/wait-and-reload!))
+                        (catch Throwable t
+                          (prn [:failed-to-compile t])
+                          (.printStackTrace t)
+                          (cljs/wait-and-reload! state)))]
+        (recur new-state))))
   ;; never really gets here, ctrl+c to stop
   :done)
 

             :public-dir (io/file "target/cljs")
             :public-path "target/cljs")
      (cljs/step-find-resources-in-jars)
      (cljs/step-find-resources "lib/js-closure" {:reloadable false})
      (cljs/step-find-resources "test-workers")
      (cljs/step-finalize-config)
      (cljs/step-compile-core)

             :public-dir (io/file "target/cljs")
             :public-path "target/cljs")
      (cljs/step-find-resources-in-jars)
      (cljs/step-find-resources "test-data")
      (cljs/step-finalize-config)
      (cljs/step-compile-core)
