-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Error building Astro project with 30k MDX files #11683
Comments
Thanks, are most of these posts mdx? |
Yes, all of these posts are MDX files. In a real project I would also have some aggregations of the posts based on various factors (a tag page, a category page, etc.) - these would be JSON files. I eventually found a solution / workaround by splitting the files to be built into different chunks, and then merging them together. I built on agamm's solution here. This solution works for now, but I have some concerns about potential issues. One is with generating a sitemap, and another is when a page queries the entire collection (e.g.,
|
Astro Info
If this issue only occurs in one browser, which browser is a problem?
This is unrelated to any a specific browser.
Describe the Bug
I'm working on an Astro project with 30,000 blog posts using Content collections, where both the Frontmatter data and the content are integrated into the page. This setup works well for a smaller number of pages (100-1000). However, when I scaled up and added more files, I encountered a
JavaScript heap out of memory
error. To address this, I started usingNODE_OPTIONS='--max-old-space-size=8192' npm run astro build
instead of the regularnpm run astro build
. While this allowed me to build more files, the process is very slow, and I'm facing a new issue where the build fails abruptly with a "Killed" message, providing no additional information for debugging.Full output using ``NODE_OPTIONS='--max-old-space-size=8192' npm run astro build`:
What's the expected result?
Finish build successfully.
Link to Minimal Reproducible Example
https://stackblitz.com/~/github.com/chrome99/build-error-astro
Participation
The text was updated successfully, but these errors were encountered: