@thheller regarding problem Illegal variable reference before declaration: i
we talked about a few days ago. Someone suggested me to use different module type
https://github.com/pmndrs/three-stdlib/issues/69#issuecomment-862871876 and I applied but getting another king of errors and does not work. Do you have anything to add here?
@ertucetin yes, don't do the resolve config. When you want to default to using esm code then use :js-options {:entry-keys ["module" "browser" "main"]}
@thheller @bbss thank you guys so much for the help! I found out how to make it work, I just used :js-options {:entry-keys ["module" "browser" "main"]}
and added ["regenerator-runtime"]
as a dep and everything works now https://github.com/ertugrulcetin/racing-game-cljs
Thanks for letting me know. I still think itโs a bug on their side. But I donโt have time to dig into it more myself so good to know this worked for you, will probably try it myself at some point. React three fiber and the other libraries are so cool!
can't look into this more now, gotta go
yeah no problem, thanks!
Is there any obvious reason why two simple (sh "cp" "-r" "from" "to")
statements are not executed (it appears) when using shadow-cljs clj-run my.ns/build-fn
? Other functions used in build-fn
work as expected.
so I tried the entry-keys as my comment there suggests, but that gave me other problems for some other packages. That resolve config actually fixed all issues for me. I was wondering if entry-keys is a bit too general, might not you want to use esm for some but not for other libraries, probably misunderstanding how it works..
@ertucetin the error you have now seems related to three-mesh-bvh
which I don't use, perhaps you could also add a resolve config for that library.
@dawdler I susppose checking the return value :out
and :err
would tell you?
well it all depends on what kind of packages you use. if you are mostly using commonjs packages then the above wouldn't help much. if you have some kind of bad mix things get complicated.
in any case you should NEVER be using :target :file
for npm packages
oh yeah, definitely on a mix of bad things! I'm happy I can keep it going with the more recent versions of these libaries.
oh, I'm not sure where I got that from..
so
{"three-stdlib" {:target :npm :require "three-stdlib/index.js"}
"@react-three/drei" {:target :npm :require "@react-three/drei/index.js"}
"@react-three/fiber" {:target :npm :require "@react-three/fiber/dist/react-three-fiber.esm.js"}
"@react-three/cannon" {:target :npm :require "@react-three/cannon/dist/index.js"}}
@thheller bah, thanks. worked in repl, which is why I was confused.
I'll try that out.
still haven't had time to look at this at all so I don't know why its necessary in the first place. really shouldn't be. maybe I can take a look tomorrow
Hi I want to use [cljsjs/date-fns "2.20.2-1"] in shadow-cljs... how can I include this dependency ?
well my end-goal need is a lib i can use to make a calendar app. if that helps / short circuits this need
If a library exists in NPM such as "date-fns" do I still need to include it in the :dependencies [[]]
key in shadow-cljs.edn?
npm install date-fns
did the trick i think.