Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
Given the following project:


;; file src/foo.cljs
(ns foo
  (:require [cljs.js :as cljs]))

(defn -main []
  (enable-console-print!)
  (println "hello"))



;; file deps.edn
{:deps {org.clojure/clojure {:mvn/version "1.10.0-RC5"}
        org.clojure/clojurescript {:mvn/version "1.10.439"}
        }
 :aliases {:build-simple {:main-opts ["-m" "cljs.main" "-O" "simple" "-co" "{:pretty-print,false,:optimize-constants,true,:static-fns,true}" "-d" "out" "-c" "foo"]}}}


the following stacktrace is seen:


Exception in thread "main" clojure.lang.ExceptionInfo: failed compiling file:out/cljs/core.cljc {:file #object[java.io.File 0x7e7f3cfd "out/cljs/core.cljc"]}
...
Caused by: clojure.lang.ExceptionInfo: Assert failed: Circular dependency detected, cljs.core -> cljs.core
...
Caused by: java.lang.AssertionError: Assert failed: Circular dependency detected, cljs.core -> cljs.core
...


This exception does not happen when {{:optimize-constants}} is set to {{false}} or when {{cljs.js}} is not required.

This setting was proposed in the following guide on the CLJS website: https://clojurescript.org/guides/self-hosting

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-3021 (reported by borkdude)
...