Skip to content

fix(cli): prevent duplicate SSG output on rebuild - #5702

Merged
ealmloff merged 3 commits into
DioxusLabs:mainfrom
sanmaxdev:fix/ssg-rebuild-duplicate-html
Jul 26, 2026
Merged

fix(cli): prevent duplicate SSG output on rebuild#5702
ealmloff merged 3 commits into
DioxusLabs:mainfrom
sanmaxdev:fix/ssg-rebuild-duplicate-html

Conversation

@sanmaxdev

Copy link
Copy Markdown
Contributor

Summary

  • Run SSG builds in client-first sequential order so index.html is refreshed before prerendering starts.
  • Keep the existing parallel path for non-SSG builds.
  • Correct the --force-sequential help text to match the actual client-first order.

Root cause

The server build could finish first during a parallel fullstack build and start SSG against the previous client output. On repeated builds, that meant prerendering could use already-generated SSG HTML as its template and inject the page again.

Requiring sequential order for SSG makes the client rewrite the clean HTML template before the server starts prerendering.

Verification

  • cargo check -p dioxus-cli --tests
  • Regression coverage for parallel, explicitly sequential, and SSG build-order selection
  • git diff --check

Fixes #5608

@sanmaxdev
sanmaxdev requested a review from a team as a code owner July 23, 2026 10:00

@ealmloff ealmloff left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! We could still do builds in parallel as long as we keep the ssg rendering after web finishes its index.html update, but this is a fine solution for now

@ealmloff
ealmloff merged commit ad05395 into DioxusLabs:main Jul 26, 2026
19 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSG builds create duplicate contents if you don't clear the build output

2 participants