adminjs-design-system icon indicating copy to clipboard operation
adminjs-design-system copied to clipboard

Components throw Undefined theme inside dev console

Open julianbrasolin opened this issue 11 months ago • 3 comments

hello, im using vite to create a react app and tried following the readme in order to get started using design system, but at the time of running the app i get an error in the dev console saying the theme (lineheights.default) is undefined. i tried debugging if the theme passed as context in the theme provider was valid and it is, its printing fine, but its throwing an error inside ThemeProvider

Image Image Image

julianbrasolin avatar Feb 06 '25 15:02 julianbrasolin

Not 100% sure, but I think you might have to import from @adminjs/design-system/styled-components. We have a custom export of styled components because at the time we were rewriting the codebase to ESM, styled-components exported it's modules incorrectly and there were some browser issues. Just do note that styled is a named export from @adminjs/design-system/styled-components.

https://github.com/SoftwareBrothers/adminjs/blob/master/src/frontend/bundle-entry.jsx#L1

dziraf avatar Feb 06 '25 15:02 dziraf

thanks for your response! gonna try that now

julianbrasolin avatar Feb 06 '25 15:02 julianbrasolin

that was it! man, thank you so much! 🫂

julianbrasolin avatar Feb 06 '25 15:02 julianbrasolin