Uploaded image for project: 'ClojureScript'
  1. CLJS-2763

cljs.core/resolve fails under :advanced compilation (regression)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not Reproducible
    • Affects versions: 1.10.238
    • Fix versions: None
    • Labels:
      None
    • Approval:
      Screened

      Description

      The macro cljs.core/resolve does not produce sufficient information to invoke (when using :advanced compilation) a function across module boundaries under certain conditions.

      With :advanced compilation, the attempt of module A to invoke the function in module B after load then fails at runtime. The issue occurs when using 1.10.238, but does not occur when using 1.9.946.

      A minimal repro is provided below:

      deps.edn
      {:deps {org.clojure/clojurescript {:mvn/version "1.10.238"}}}
      
      build.edn
      {:output-dir "out"
       :optimizations :none
       :modules
       {:a {:output-to "out/a.js"
            :entries [demo.a]}
        :b {:output-to "out/b.js"
            :entries [demo.foo.b]
            :depends-on #{:a}}}
       :verbose true}
      
      src/demo/a.cljs
      (ns demo.a)
      
      (resolve 'demo.foo.b/bar)
      
      src/demo/foo/b.cljs
      (ns demo.foo.b)
      
      (defn bar [] :bar)
      
      index.html
      <html>
          <body>
              <script src="out/cljs_base.js"></script>
              <script src="out/a.js"></script>
          </body>
      </html>
      

      The repro can be compiled by running clj -m cljs.main -co build.edn -c

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              symfrog Pieter du Toit
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: