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?PD: reposted because I pressed the wrong button in Slack, and IDK what I did
Just found a related issue in the library: https://github.com/hypeserver/react-date-range/issues/658
that is indeed very weird
yeah, unfortunately the closure compiler is sometimes too strict and fails code that otherwise "works"
nothing you can do other than manually editing the file and removing the offending bit
Ok, thanks!