Skip to content
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

SAVE_DEBOUNCE_MS Too Short Causes Incomplete Data in data-store.json #13310

Open
1 task
justin5267 opened this issue Feb 25, 2025 · 1 comment
Open
1 task
Labels
- P2: has workaround Bug, but has workaround (priority) feat: content layer Related to the Content Layer feature (scope)

Comments

@justin5267
Copy link

justin5267 commented Feb 25, 2025

Astro Info

Astro                    v5.3.1
Node                     v22.14.0
Node_options             max-old-space-size: 12000
System                   Windows (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Starlight Version:       0.32.1
Page Count:              800+

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

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Feb 25, 2025
@justin5267
Copy link
Author

Steps to Reproduce:

  1. Clone the repository:

git clone https://github.com/justin5267/test.git

  1. Install dependencies:

pnpm install

  1. Run the development server:

pnpm run dev

  • If the generated data-store.json is noticeably smaller than 540MB, it means not all pages were generated. Accessing /docs/w1-1.html or any file later in alphabetical order will result in a 404 error.This reproduces Bug 1. You can continue to steps 4-6 to reproduce Bug 2.

  • Sometimes, this step will generate the complete data-store.json. If this happens, delete the .astro cache directory and rerun pnpm run dev to reproduce Bug 1.

  1. Run the build command:

pnpm run build

  • You will see the error: "The collection 'docs' does not exist or is empty. Please check your content config file for errors." This successfully reproduces Bug 2.
  1. Modify the SAVE_DEBOUNCE_MS to 5000 and run:

pnpm run dev

  • This time, the data-store.json will be generated completely, indicating that the issue is related to this setting.

6.Run the build command again:

pnpm run build

  • The error "The collection 'docs' does not exist or is empty. Please check your content config file for errors." will persist, reproducing Bug 2.

@ematipico ematipico added - P2: has workaround Bug, but has workaround (priority) feat: content layer Related to the Content Layer feature (scope) and removed needs triage Issue needs to be triaged labels Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: has workaround Bug, but has workaround (priority) feat: content layer Related to the Content Layer feature (scope)
Projects
None yet
Development

No branches or pull requests

2 participants