Fork me on GitHub

I'm trying to debug a react library react-sortable-hoc I installed it locally using npm install extern/react-sortable-hoc. The package.json file contains the following:

"dependencies": {
    "create-react-class": "^15.6.2",
    "left-pad": "file:extern/left-pad",
    "react": "^16.0.0",
    "react-dom": "^16.0.0",
    "react-sortable-hoc": "file:extern/react-sortable-hoc"
I have also checked that node_modules/react-sortable-hoc is pointing to the extern/react-sortable-hoc. But when I refer to this library from cljs, the following error appears
[:frontend] Build failure:
The required JS dependency "react-sortable-hoc" is not available, it was required by "sortable/frontend/sortable.cljs".

Searched in:sortable/node_modules
As a test, I git-cloned the left-pad library and installed it locally, but it works.
(:require [reagent.core :as r :refer [atom]]
            [reagent.ratom :refer-macros [reaction]]
            ["react-sortable-hoc" :as rsh]
            ["left-pad" :as lp]


@richiardiandrea shadow-cljs just calls npm install <packages-from-deps-cljs> or yarn add <packages> (if yarn.lock) exists


no idea about .npmrc if that needs an extra flag or something?


@priornix are you sure that there are all the actual files in node_modules/react-sortable-hoc? npm sometimes leaves empty directories (non-linked)


@priornix did you build the react-sortable-hoc? the git repo does not contain the dist files so that may be the problem?


@thheller Thanks, I only ran npm install. Running npm run-scripts build works.

đź‘Ť 4

This is probably obvious, but I can’t immediately work out how I see or configure or update the clojurescript version that an existing shadow-cljs project depends on? There’s no mention in the package.json, shadow-cljs.edn (or project.clj - I’m using cursive).


@grumplet shadow-cljs has a default version is depends on. I do not recommend changing that.


the latest version depends on 1.10.439


ie. if you update shadow-cljs that will usually update the CLJS version with it


may need manual tweaking in project.clj


Ah thanks. Just found that the version is listed in This wasn’t an immediate need, but I have had reason to change the clojurescript version I depended on in other non-shadow projects, so got to thinking…


shadow-cljs typically depends on the latest release. downgrading may not always be possible. 2.7.0 for example requires 1.10.439+ since there were some breaking changes in the cljs.analyzer (given that breaking changes are quite rare)

Logan Powell13:11:03

I'm getting this in my compiled/released javascript. Does the compiler remove tests that are included as {:test #(assert...)} metadata of a function? If not, I can pull them out. I just liked that I could have my tests right next to my functions...


Just curious, are people still compiling their SASS for their CLJS app in a separate process? Or is there something built-in to shadow-cljs?


@kenny nothing built-in for sass (yet)


@loganpowell asserts are typically elided but that particular way to add tests might not be depending on whether you accessed the var somewhere

Logan Powell17:11:58

Thanks man. I'm moving the tests out of the metadata currently, so I'll let you know


I am still debugging a problem where the yarn add that Shadow launches is not see my .yarnrc ...


can it be that environment vars like HOME are not set when the shell with yarn add is launched?