shadow-cljs

Bingen Galartza Iparragirre 2025-02-06T15:19:16.988219Z

Not sure if this is the right channel for this. I'm trying to include the https://github.com/hypeserver/react-date-range/tree/master in a project, and I get the following error:

Closure compilation failed with 1 errors
 --- node_modules/react-date-range/dist/components/DateRange/index.js:145
Illegal variable reference before declaration: color
I read other comments in this channel, and it's apparently related to the Closure Library being strict on the libraries JS code. I looked the code and apparently the compiler complains about https://github.com/hypeserver/react-date-range/blob/master/src/components/DateRange/index.js#L123C83-L123C84. I don't control regular JS, but the || color part looks wrong to me? Can you do that? Any JS expert on the room?

Bingen Galartza Iparragirre 2025-02-06T15:20:02.119129Z

PD: reposted because I pressed the wrong button in Slack, and IDK what I did

Bingen Galartza Iparragirre 2025-02-06T15:20:10.517849Z

Just found a related issue in the library: https://github.com/hypeserver/react-date-range/issues/658

thheller 2025-02-06T15:30:38.035199Z

that is indeed very weird

thheller 2025-02-06T15:31:12.978139Z

yeah, unfortunately the closure compiler is sometimes too strict and fails code that otherwise "works"

thheller 2025-02-06T15:31:39.245409Z

nothing you can do other than manually editing the file and removing the offending bit

Bingen Galartza Iparragirre 2025-02-06T15:49:05.887419Z

Ok, thanks!