Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module '@chakra-ui/react' or its corresponding type declarations

I'm trying to install @chakra-ui and use it with Next, but it doesn't work at all. I uninstalled and installed it again and it doesn't work.

I used npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6 didn't show any error on installation, but when I go to use import {} from '@chakra-ui/react' it just doesn't work, it says:

Cannot find module '@chakra-ui/react' or its corresponding type declarations.

like image 719
alanfljesus Avatar asked Jan 21 '26 11:01

alanfljesus


2 Answers

Sometimes it happens due to a TS server error. So ideally click ctrl+shift+p (Windows) and select the option "restart ts server". Had this issue many times and usually fixed import issues.

like image 95
Webdev I'm Avatar answered Jan 23 '26 09:01

Webdev I'm


I fixed this by uninstalling then re-installing chakra-ui. Try this:

npm uninstall @chakra-ui/react

then re-install:

npm install @chakra-ui/react
like image 23
Vic Avatar answered Jan 23 '26 07:01

Vic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!