<< Back to previous view

[CLJS-2394] npm modules not inserted into cljs_deps when compiler is restarted Created: 02/Nov/17  Updated: 17/Nov/17  Resolved: 17/Nov/17

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: 1.10.238
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Hendrik Poernama Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: None

Attachments: Text File CLJS-2394-patch-1.patch    

 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. 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.



 Comments   
Comment by Hendrik Poernama [ 02/Nov/17 6:49 AM ]

Fix attempt

Comment by David Nolen [ 17/Nov/17 3:17 PM ]

fixed https://github.com/clojure/clojurescript/commit/2389e52049a9bd001d173a1cb4772ed8a25de196

Generated at Sun May 19 04:19:50 CDT 2019 using JIRA 4.4#649-r158309.