-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Memory Leak]: Builds incorporating Shiki Twoslash crash with JavaScript heap out of memory errors #4242
Comments
Yeah https://github.com/shikijs/shiki/issues might be better place to post this. I'm fine with keeping this open if it's indeed a memory leak with vitepress. |
No problem, makes sense to me - I've gone ahead and opened an issue upstream. Linking here for tracking purposes: shikijs/shiki#796 |
I started experiencing these issues today with Graffle's website as well. https://github.com/jasonkuhrt/graffle/actions/runs/11129348920/job/30926231362?pr=1151. Nothing more to add than what @IMax153 has already said. |
@jasonkuhrt If possible, do you have the exact commit which started giving these? If it's recent then it might have something to do with newer shiki releases. 👀 |
Hey @brc-dd, it started failing on this commit ade5a3e61ad536484968880d9218bdcdf4a66ac1. It's a huge commit unfortunately. You can see under the website directory no version of any dependencies changed in it fwiw. |
Hmmmm. I am not using any twoslash plugins, but encountered the similar issue after bumpping up Nolebase's dependencies, will investigate more to find out which dependency was causing this. Similar setup with VitePress, with twoslash plugin (and actually the tool set used to build Nolebase website) in Nolebase Integrations cannot reproduce this OOM issue.
|
I did a investigation, found that starting from But not sure which line of change caused this... vuejs/core@v3.5.5...v3.5.6 Update: NVM, I think this is related to Vite or other dependencies, even with [email protected] (previously working one), if vite is updated to 5.4.8 or vitepress updated to 1.4.0 (not sure which one yet), then this issue presist. |
Describe the bug
Hello 👋 from the Effect-TS community :)
We have recently been experimenting with using different frameworks for building our documentation website. I decided to try building our documentation with Vitepress because of your native integration with Shiki Twoslash (via
@shikijs/vitepress-twoslash
), which we make extensive use of in our docs.However, when I attempt to build our documentation with Vitepress and Shiki Twoslash, I consistently receive a
JavaScript heap out of memory
error. I have attempted to increase the--max-old-space-size
to ~8GB and still encounter this issue.With Twoslash Integration
In my
.vitepress/config.ts
, if I remove thetransformerTwoslash
from themarkdown.codeTransformers
array, the build succeeds without issue in ~20 seconds.Without Twoslash Integration
Also, please let me know if it is more appropriate to move this issue to the Shiki project. If so, I have no problem closing this issue and moving it 👍 Thank you for your time!
Reproduction
Clone our docs experiment
Install dependencies
Attempt to build
Expected behavior
My expected behavior would be for Vitepress to be able to build our docs with Shiki Twoslash integrated without issue.
System Info
Additional context
I've included a script in the
package.json
that reduces the available NodeJS heap memory (to force an OOM earlier) and takes a heap snapshot right before an OOM error occurs in case that is useful for you folks.Validations
The text was updated successfully, but these errors were encountered: