useBreakpointValue - Cannot convert undefined or null to object
See original GitHub issue🐛 Bug report
Just updated from "@chakra-ui/core": "^1.0.0-rc.8"
to "@chakra-ui/react": "^1.1.4",
and now I’m getting this error:
TypeError: Cannot convert undefined or null to object
on this line:
const size = useBreakpointValue({ base: 'full', sm: 'xs' })
Which used to work just fine.
💥 Steps to reproduce
Link to codesandbox
🧐 Expected behavior
Don’t throw an error and worked as it was working on previous versions?
Issue Analytics
- State:
- Created 3 years ago
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Cannot convert undefined or null to object - Stack Overflow
Generic answer. This error is caused when you call a function that expects an Object as its argument, but pass undefined or null...
Read more >cannot convert undefined or null to object react - You.com
Type Error: Cannot convert undefined or null to object The issue is that you can't create an array of keys from an undefined...
Read more >Cannot convert undefined or null to object : r/learnjavascript
For some reason, when I fetch data and console.log it, it displays the data. But when I set it to a state, it...
Read more >@chakra-ui/react Switch TypeScript Examples
underlyingToken); const supplyAPY = convertMantissaToAPY(asset. ... Code: " + response, description: "You cannot disable this asset as collateral as you ...
Read more >Cannot convert undefined or null to object - JavaScript
JavaScript : How to resolve TypeError: Cannot convert undefined or null to object [ Gift : Animated Search Engine ...
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
You’re using
useBreakpointValue
outside ofChakraProvider
, so it doesn’t have access to the theme in order to read the breakpoints.I’m facing this problem also. Using
"@chakra-ui/react": "^1.6.2"
.On initial page load,
useBreakpointValue
returnsundefined
. After that, it returns the correct value.