Fork me on GitHub
#shadow-cljs
<
2022-01-24
>
superstructor07:01:51

Anyone familiar with these kind of compilation errors in the three.js ecosystem ? Simply just installing and trying to require @react-three/fibre or @react-three/drei is enough to get this error.

Closure compilation failed with 2 errors
--- node_modules/three-stdlib/index.cjs.js:2
Illegal variable reference before declaration: i
--- node_modules/three-stdlib/index.cjs.js:2
Illegal variable reference before declaration: t

thheller17:01:48

yeah I'm not sure if this is a bug in the closure compiler or an actual bug in the lib

thheller17:01:22

the closure compiler checks might be too strict but I really can't say

bbss11:02:05

@U0G75S29H I ran into it, currently running versions "@react-three/drei": "^7.5.0", "@react-three/fiber": "6.1.1", And have in my shadow-cljs.edn module:

:js-options {                        :resolve {"three-stdlib" {:target :file :file "node_modules/three-stdlib/index.js"}
                                  "@react-three/drei" {:target :file :file "node_modules/@react-three/drei/index.js"}
                                  "@react-three/fiber" {:target :file :file "node_modules/@react-three/fiber/dist/react-three-fiber.esm.js"}}}

achikin11:01:03

@thheller I just found out that there is a new :preprocess option for foreign libs in clojurescript compiler. Are there any plans to leverage that for npm libs in shadow-cljs?

thheller17:01:15

shadow-cljs doesn't support foreign-libs at all, so no preprocess either. what problem are you trying to solve?

achikin11:01:38

Still trying to get jsx/css preprocessors without webpack etc.

thheller16:01:22

for css just use postcss or something

thheller16:01:05

there is an example setup using tailwind here https://github.com/jacekschae/shadow-cljs-tailwindcss

thheller16:01:12

I use a very similar setup