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

npm modules not inserted into cljs_deps when compiler is restarted

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: 1.10.238
    • Fix versions: None
    • Labels:
      None

      Description

      When restarted, compiler would rewrite cljs_deps and remove all npm modules dependency. Problem only appears when rebuilding, not from clean compilation.

      Workaround: Do a clean build every time compiler has to be restarted.

      Minimal example: https://github.com/poernahi/cljsbuild_wrongdeps

      Steps to reproduce using above example:
      1. Copy/symlink clojurescript uberjar into project root as cljs.jar
      2. make clean && make && wc -l out/cljs_deps.js # Should return 186 lines
      3. touch src/cljsbuild_wrongdeps/core.cljs && make && wc -l out/cljs_deps.js # Now returns only 4 lines!!

      I think this is related to CLJS-2339 Closed . I narrowed down to this line
      https://github.com/clojure/clojurescript/commit/245bdee2c35e19a9685b7a0849f26fce8bdaf7ca#diff-84ffd22349e5ca1fe6322cb0e379b3b1R2250

      When a new compiler instance is run, the cache in ::transitive-dep-set is empty and index-node-modules return nil.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hpnm poernahi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: