Hi guys, I'm facing a strange issue when trying to use Uber's baseui with more recent versions of shadow-cljs. All UI components seem to work fine except for the Tag component, which gives the following error:
styled-components.js:381 Uncaught TypeError: Cannot read properties of undefined (reading 'secondary')
at eval (styled-components.js:381:7)
at eval (index.js:291:74)
at resolveStyle (index.js:489:14)
at eval (index.js:405:17)
at Object.react_stack_bottom_frame (react-dom-client.development.js:23865:20)
at renderWithHooks (react-dom-client.development.js:5531:22)
at updateForwardRef (react-dom-client.development.js:8647:19)
at beginWork (react-dom-client.development.js:10863:18)
at runWithFiberInDEV (react-dom-client.development.js:1521:30)
at performUnitOfWork (react-dom-client.development.js:15134:22)
This looks like a parsing error related to this line of code (https://github.com/uber/baseweb/blob/main/src/tag/styled-components.ts#L415), but that's beyong my knowledge and skills.
I created a repo where the error can be reproduced: https://github.com/EduardoMRB/base-ui-tag-repro
Relevant base-ui code at: https://github.com/EduardoMRB/base-ui-tag-repro/blob/master/src/main/app/ui/root.cljs#L29-L32
If I'm not mistaken, the last version of shadow-cljs that I could use without issues with base-ui was 2.11.7.I updated the repo removing a ton of lines and files, and confirmed that the same react, baseui and styletron version combination work in a typescript project setup. I hope this helps, and thank you very much for having a look already.
its still using a rather old shadow-cljs version. can you try upgrading that too?
Absolutely. Just tried with 3.4.11 and got the same behavior, will push the change right away for reference
Hi @thheller, sorry about that, I just used a fulcro application template as the starting point, that's why it's so big. And regarding the version, that's how the uber team decided to go about them after they started mirroring their internal repository, that's not indicative of an alpha version of something like that. Would it help if I reduce the repro code down to the absolutely necessary and check the same exact versions of styletron and baseui in a typescript setup first?
sorry but this repo is way too huge and I'm not going to debug anything that uses "baseui": "^0.0.0-next-c10b736ad", kind of versions
my immediate first guess is versions conflicts. baseui not liking your styletron (whatever that is) or react versions