SAVE_DEBOUNCE_MS Too Short Causes Incomplete Data in data-store.json #13310
Labels
- P2: has workaround
Bug, but has workaround (priority)
feat: content layer
Related to the Content Layer feature (scope)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Bug 1: The SAVE_DEBOUNCE_MS value is too short, causing incomplete page generation during development.
Running "pnpm run dev", pages with filenames later in the alphabet (in the docs folder) are skipped, and corresponding pages are not generated. Upon checking data-store.json, the missing pages were not included, and the file size is only 180-190MB.
Modifying "SAVE_DEBOUNCE_MS" from 500 to 5000, and running "pnpm run dev" again will resolve the above issue. All pages generate correctly, and the size of data-store.json increases to approximately 540MB.
Bug 2: Something prevents all pages in docs from being built.
Even after modifying SAVE_DEBOUNCE_MS to 5000, when running pnpm run build, the error "The collection 'docs' does not exist or is empty. Please check your content config file for errors." persists, preventing all pages in docs from being built.
I'm unsure of the cause, but I suspect it may be related to or similar to Bug 1, as this issue neither occurs when the data-store.json file size was smaller, nor occurs when building with Astro v4.
What's the expected result?
Increase the default SAVE_DEBOUNCE_MS value, or allow users to customize it.
Resolve the issue where, when the project documentation is large and contains many pages, the build fails with the error "The collection 'docs' does not exist or is empty."
Link to Minimal Reproducible Example
Due to copyright reasons, I cannot share the actual project, but I will try to create a test project by adjusting the file size to reproduce the issue.
Participation
The text was updated successfully, but these errors were encountered: