Quick question - what is the "correct" way to package up a library with node dependencies? I've tried adding the list of them to deps.cljs
in src, but including the dependency from clojars in a shadow project elsewhere didn't seem to install them.
how did you package it? I mean is the deps.cljs
file actually included with the jar? what is the clojars lib?
Ooo it doesn't look like it is in the jar
deps.cljs
with {:npm-deps {"foo" "version"}}
is the correct way
And does it go in the root of the project or next to the source, I wasn't quite sure
into the root of one of your source paths
so src/deps.cljs
in your case
Ah I see, I think I put it too deep the first time I tried
Success! Thank you @thheller!
Could somebody help to test this repo? https://github.com/damesek/example-error I created from this, and still not work on my computer, but there is a screenshot too that is works. From here: https://stackoverflow.com/questions/58852849/clojurescript-date-timepicker-with-cljsjs-react-day-picker. I got this react.development.js:316 Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
I think, that is a same issue at all packages.. as I feel. I canβt find out, maybe very trivial.. π
read and understand the translation table here https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
then compare the JS code from the example docs with the CLJS code you have
and you'll find the problem
thanks!!
note that looking at "old" example may not be correct today
JS packages often change how they bundle stuff so the way you require them may change as well
Ok, β¦ now works all. :man-facepalming::picard-facepalm: thanks the help!