Next.js Discord

Discord Forum

Importing styled-octicons causes massive bloat during development with next dev

Unanswered
Holland Lop posted this in #help-forum
Open in Discord
Holland LopOP
When importing icons from styled-octicons my Next server grinds to a halt (14.0.4), with the build bloating from a few megabytes to 400 MB. Are there any options I can set to fix this in Next? Description here: https://github.com/primer/octicons/issues/981

9 Replies

Holland LopOP
Usage:
import { CommentIcon } from '@primer/styled-octicons';
Holland LopOP
Added the following to my next config and rebooted server, same result:
transpilePackages: [
  '@primer/octicons-react',
  '@primer/styled-octicons'
],
Also takes multiple minutes to boot server
Holland LopOP
Thanks, that did speed it up a lot - went to 40 MB loaded now + build is much faster
One submitted PR to the icon repo seems to maybe fix the underlying issue, added a comment there
Holland LopOP
Thank you guys 🙏