shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
ertugrulcetin 2021-06-12T15:38:23.003200Z

Hi all, I'm having a problem with @react-three/drei library. When I require it ["@react-three/drei" :refer [Sky Environment]], I 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
I've tried a couple of :js-options options did not work out:
{:js-provider :shadow
 :keep-native-requires true
 :output-feature-set :es6
 :closure-output-charset "ascii"}
Here is my package.json:
"@pmndrs/branding": "^0.0.8",
"@react-three/cannon": "2.1.2",
"@react-three/drei": "6.0.2",
"@react-three/fiber": "7.0.1",
"@react-three/postprocessing": "2.0.4",
"@types/three": "0.129.1",
"lodash-es": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"three": "0.129.0",
Any suggestions?

thheller 2021-06-12T16:06:34.004100Z

not much you can do config-wise. according to the closure-compiler there seems to be some invalid code. I guess you can use webpack as described in this post https://code.thheller.com/blog/shadow-cljs/2020/05/08/how-about-webpack-now.html

thheller 2021-06-12T16:07:09.005100Z

which version of shadow is this? if not the latest maybe an upgrade might help

thheller 2021-06-12T16:08:02.005600Z

sometimes code is actually invalid and webpack just happens to make it work due to its processing

ertugrulcetin 2021-06-12T21:30:41.005900Z

@thheller "shadow-cljs": "2.12.5"