DEV Community

RaFi
RaFi

Posted on

How to fix "Expression produces a union type that is too complex to represent. ts(2590)"?

the short solution

__For anyone that doesn't work the accepted solution try to delete the **node_modules **folder in your project and run again _npm install or yarn install

Running both commands was triggering the issue for me._

and long solution

the problem is after define chakra/ui tag has a red line

import { Flex } from '@chakra-ui/react';
  <Flex bg="white" height="42px" padding="6px 12px">
Navbar

    </Flex>
Enter fullscreen mode Exit fullscreen mode
  1. Open a JavaScript or TypeScript file in VS Code. In the VS Code command palette (F1 is the shortcut by default), run the TypeScript: Select TypeScript version command. Make sure you have Use workspace version selected

Also you could check this answer for @mui/material relative error

Top comments (0)