To fix this typescript error, add the following line:
import type {} from '@mui/material/themeCssVarsAugmentation';
see https://mui.com/material-ui/customization/css-theme-variables/usage/#typescript