mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

TypeError: Cannot use 'in' operator to search for 'xs' in undefined #6900

Closed rishabh-te closed 1 month ago

rishabh-te commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

@mantine/carousel. 7.13.0

What package has an issue?

@mantine/carousel

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

I tried using @mantine/carousel

⨯ ../src/core/utils/get-breakpoint-value/get-breakpoint-value.ts (4:7) @ breakpoint ⨯ TypeError: Cannot use 'in' operator to search for 'xs' in undefined at Array.map () digest: "418810984" 2 | import { px } from '../units-converters'; 3 |

4 | export function getBreakpointValue(breakpoint: number | string, theme: MantineTheme) { | ^ 5 | if (breakpoint in theme.breakpoints) { 6 | return px(theme.breakpoints[breakpoint as MantineBreakpoint]) as number; 7 | }

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

rtivital commented 1 month ago

Please provide a sandbox with a minimal reproduction. Template – https://codesandbox.io/s/mantine-react-template-q4dd5d?file=/src/App.js

rishabh-te commented 1 month ago

Hi @rtivital here is code .

https://codesandbox.io/p/sandbox/mantine-react-template-forked-ghx4rr

Thanks

jackkweyunga commented 1 month ago

Am facing same issue. Am using exact versions as described in the issue.

rishabh-te commented 1 month ago

@jackkweyunga switching to 7.12.2 might solve this problem instead of 7.13.0

jackkweyunga commented 1 month ago

@jackkweyunga switching to 7.12.2 might solve this problem instead of 7.13.0

This worked. Thanks @rishabh-te

llezhava commented 1 month ago

I upgraded @mantine/core .etc mantine libraries to 7.13.1 and it worked.

rtivital commented 1 month ago

I cannot reproduce the issue with 7.13.1 – https://codesandbox.io/p/sandbox/mantine-react-template-forked-36fvdc It seems like it has been already resolved in the current version. To resolve the issue, update dependencies to the latest version and make sure that all @mantine/ packages have the same version in package.json.