rehype-pretty / rehype-pretty-code

Beautiful code blocks for Markdown or MDX.

Home Page:https://rehype-pretty.pages.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javacript heap out of memory

soyuka opened this issue · comments

Hi, thanks for the project, it's the fastest and the most customizable way of adding syntax highlight to our nextjs-based build system. However, I'm trying to run this over 2k files and if I enable syntax highlighting I get a beautiful FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory error.

Reproduction repository at https://github.com/soyuka/nextjs-mdx-highlight :

  1. pnpm install
  2. next build

What do you think ? Is there a way that this gets optimized, is it because of the nextjs build system? Do you want me to create a reproducer without next and mdx? Clearly this builds if I remove the rehype-pretty-code middleware.

comes from nextjs itself