TypeError: Cannot read properties of undefined (reading 'dark')
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
I am migrating a project create with create-react-app from v5, and I am getting the following error for every page:
Expected Behavior 🤔
An app should load.
Steps to Reproduce 🕹
This was causing the issue:
<Button
variant="contained"
color="default"
size="medium"
startIcon={<AddIcon />}
component={Link}
to="/create"
>
Removing color
property fixed the issue.
Context 🔦
Your Environment 🌎
`npx @mui/envinfo`
I use Google Chrome.
System:
OS: macOS 11.6
Binaries:
Node: 14.4.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 7.20.1 - /usr/local/bin/npm
Browsers:
Chrome: 93.0.4577.82
Edge: Not Found
Firefox: 88.0.1
Safari: 14.1.2
npmPackages:
@emotion/react: ^11.4.1 => 11.4.1
@emotion/styled: ^11.3.0 => 11.3.0
@mui/core: 5.0.0-alpha.47
@mui/icons-material: ^5.0.0 => 5.0.0
@mui/material: ^5.0.0 => 5.0.0
@mui/private-theming: 5.0.0
@mui/styled-engine: 5.0.0
@mui/system: 5.0.0
@mui/types: 7.0.0
@mui/utils: 5.0.0
@types/react: 17.0.21
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: 4.4.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: Cannot read properties of undefined (reading 'dark')
TypeError : Cannot read properties of undefined (reading 'dark'). I've checked the previous errors and MaterialUI site, but could not figure ...
Read more >TypeError: Cannot read properties of undefined (reading 'dark ...
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >cannot read properties of undefined (reading 'dark') - You.com
There are 3 main reasons the "Cannot read properties of undefined" error occurs: Accessing a property on a variable that stores an undefined...
Read more >Uncaught TypeError: Cannot read properties undefined
[This thread is closed.] Javascript Error: Uncaught TypeError: Cannot read properties of undefined (reading 'setAttribute') at Object.menu…
Read more >[Vue warn]: Error in render: "TypeError - Laracasts
... in render: "TypeError: Cannot read property 'smAndDown' of undefined" ... xs4> <v-btn @click="sendMessage" dark class="mt-3 ml-2 white--text" small ...
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 Free
Top 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
The button no longer support the
default
color. These are the valid color values:See the API page - https://mui.com/api/button/
Im also getting this error on my nextJS project with v5, my is “Cannot read properties of undefined (reading ‘main’)”