NextJS 10 with Material UI compiling too slow

Viewed 1336

I have a project with many components, but event if I work on isolated components when I save the file and NextJS compile it takes too long. My develop time is affected by this issue.

I run 4 GB of RAM, but it is still slow

cross-env NODE_OPTIONS="--max_old_space_size=4096" next

How can I solve this issue ?

What are the possible problems ?

1 Answers

If you import components using

import {List,Grid,ListItem} from '@material-ui/core';

instead try use

import List from '@material-ui/core/List';
import Gridfrom '@material-ui/core/Grid';
import ListItem from '@material-ui/core/ListItem';

that's worked for me.

Related