How I fixed the Chakra UI List component not found error by updating to the latest version.

how-i-fixed-the-chakra-ui-list-component-not-found-error-by-updating-to-the-latest-version.

Introduction

While developing an app with React (Vite + TypeScript), I introduced Chakra UI as my UI library.
Basic components (Box, Heading, Text, etc.) worked, but I encountered an error when importing List and ListItem, as shown below.

import { Box, Heading, Text, List, ListItem } from "@chakra-ui/react";

The error message I received was:

Attempted import error: 'List' is not exported from '@chakra-ui/react'

Apparently, the version of @chakra-ui/react included in my project was outdated, and the List component was not yet included.

Solution

Updating to the latest version resolved the issue.

npm install @chakra-ui/react@latest @emotion/react @emotion/styled framer-motion

Then, restart the development server:

npm run dev

Results

  • The screen now displays correctly.

  • All Chakra UI components, including List and ListItem, are now available.

  • Type errors have disappeared, and red lines no longer appear in VSCode.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
tcjsgame-movement-utilities:-complete-reference-guide

TCJSGame Movement Utilities: Complete Reference Guide

Next Post
lightning-lectures

Lightning Lectures

Related Posts