Fork me on GitHub

RE: possible node module indexing bug in CLJS compiler > I think “node module indexing” is what it’s called 😬 If you use an NPM library which specifies a :main file with a .cjs ext in its package.json (see CLJS can’t find it during the process. This issue seems to have also been mentioned on To verify this, I went into my project’s local node_modules package for react-chartjs-2 and updated the main from ./dist/index.cjs to ./dist/index.js . This resolved the issue. Once I confirmed the above, I then modified CLJS itself: from

(into [(str entry-path ".js") (str entry-path "/index.js") (str entry-path ".json")])))))))
(into [(str entry-path ".js") (str entry-path "/index.js") (str entry-path ".json") (string/replace entry-path #"\.cjs$" ".js")])))))))
And the above change also resolves the issue (without needing to manually update your node_modules). It would be great if more experienced CLJS compiler devs could let me know if this is indeed an issue and would a minimal repro be useful?