[Support] MakeStyles crashes with "Can't assign to property" error
See original GitHub issueI’ve recently switched from @mui/styles
to react-tss and I’m experiencing an error:
Uncaught TypeError: can't assign to property "label" on "ltr": not an object
Tracking the error down I’m lead to the makeStyles.js file, line ~45
const cssObject = cssObjectByRuleName[ruleName];
if (!cssObject.label) {
cssObject.label = `${name !== undefined ? `${name}-` : ""}${ruleName}`;
}
In this error case, the ruleName
is direction
resulting in a cssObject
of the string ltr
. Attempting to write to cssObject.label causes the error above.
I’ve checked my codebase and I’m not modifying the direction anywhere, so I don’t really understand why this is happening and could really use some assistance.
Thanks
Issue Analytics
- State:
- Created a year ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
makeStyles, withTheme and useTheme not working #14416
I'm getting an error: Uncaught TypeError: Cannot read property 'borderRadius' of undefined . Digging into it, I see that the theme object ...
Read more >MUI - makeStyles - Cannot read properties of undefined
Despite this, my code appears to follow the changes that the documentations asks for. So what could be causing this error? app.js import...
Read more >material-ui/core/CHANGELOG.md - UNPKG
The Tabs `fullWidth` and `scrollable` properties can't be used at the same time. The API change prevents any awkward usage. 22.
Read more >front-end/node_modules/@material-ui/styles/CHANGELOG.md
A way to get location (latitude and longitude), elevation, speed and other relevant data from individual satellites from the Starlink constellation.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yup that worked! Thanks, and sorry for the bother
Glad you figured it out.
This would be
withTheme
: