question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Select] Throwing a value undefined error in latest 5.6.1

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I think this is related to changes in #27299, I am getting an error that value is undefined:

TypeError: arr[0].props is undefined

Expected behavior 🤔

Should work as it does in 5.6.0

Steps to reproduce 🕹

https://codesandbox.io/s/icy-framework-72ywid?file=/src/Demo.tsx

Context 🔦

No response

Your environment 🌎

`npx @mui/envinfo`
  System:
    OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
  Binaries:
    Node: 14.18.0 - ~/.nvm/versions/node/v14.18.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v14.18.0/bin/yarn
    npm: 6.14.15 - ~/.nvm/versions/node/v14.18.0/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmPackages:
    @mui/base:  5.0.0-alpha.76 
    @mui/material: ^5.6.1 => 5.6.1 
    @mui/private-theming:  5.6.1 
    @mui/styled-engine-sc: ^5.6.1 => 5.0.0-rc.1 (5.6.1)
    @mui/system:  5.6.1 
    @mui/types:  7.1.3 
    @mui/utils:  5.6.1 
    @types/react:  17.0.35 
    react: ^18.0.0 => 18.0.0 
    react-dom: ^18.0.0 => 18.0.0 
    styled-components: 5.3.5 => 5.3.5 
    typescript: ^4.6.3 => 4.6.3 

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
boutahlilsoufianecommented, Jul 7, 2022

Hi @hbjORbj @michaldudak, I will work on this!

1reaction
wadehammescommented, Apr 13, 2022

Hi.

Thanks for the report. It indeed seems like a regression from the change in #27299 . I started a thread here.

In the meantime, you can remove {defaultMessage && <MenuItem value="All">{defaultMessage}</MenuItem>} from Select component and instead use a defaultValue prop.

Here is a working solution: https://codesandbox.io/s/suspicious-hooks-v87vwp?file=/src/RhSelect.component.tsx:1378-1447

Ill update my side to use the defaultValue, thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript error on undefined value that is checked before
1 Answer 1 · check for undefined inside if statement (preferred) · write [index as number], only if you are sure (if someone...
Read more >
react_devtools_backend.js:4026 warning: a component is ...
Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a...
Read more >
11 Debugging - Modern Statistics with R
11 Debugging. In Section 2.10, I gave some general advice about what to do when there is an error in your R code:...
Read more >
undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. ... One reason to use typeof is that it does not throw an error...
Read more >
GraphQL: Mapping Error Messages to Generic Error Codes
5.6.1.b | Field "${node.name.value}" is not defined by type ... The logic throwing errors in graphql-js sometimes indicates which section ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found