Skip to content

docs(ssr): explain server-only module reloads (fix #19114) - #23235

Open
Tiancheng-Xu wants to merge 1 commit into
vitejs:mainfrom
Tiancheng-Xu:tc/vite-ssr-reload-docs-4befd803
Open

docs(ssr): explain server-only module reloads (fix #19114)#23235
Tiancheng-Xu wants to merge 1 commit into
vitejs:mainfrom
Tiancheng-Xu:tc/vite-ssr-reload-docs-4befd803

Conversation

@Tiancheng-Xu

Copy link
Copy Markdown

Description

The recommended custom SSR setup did not explain that updates to SSR-only modules no longer reload the browser by default.

This update:

  • distinguishes low-level custom SSR setups from framework integrations
  • adds a current Environment API hotUpdate example
  • reloads the browser only when an updated SSR module is absent from the client module graph

Fixes #19114

Tests

  • pnpm exec oxfmt --check docs/guide/ssr.md
  • pnpm docs-build

This is a documentation-only change, so no runtime test was added. The VitePress build validates the page and its typed code example.

@Tiancheng-Xu Tiancheng-Xu changed the title docs(ssr): explain reloads for server-only modules docs(ssr): explain server-only module reloads (fix #19114) Aug 11, 2026
@Tiancheng-Xu
Tiancheng-Xu marked this pull request as ready for review August 11, 2026 16:11
Copilot AI lite review requested due to automatic review settings August 11, 2026 16:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the SSR guide to clarify that changes to SSR-only modules no longer trigger a browser reload by default in custom SSR middleware setups, and provides a hotUpdate-based plugin example to restore that behavior when needed.

Changes:

  • Adds a new tip section explaining SSR-only module update behavior and how it differs from framework integrations.
  • Introduces an Environment API hotUpdate example plugin to trigger a client full reload for SSR-only changes.
  • Documents where to wire the plugin into the existing custom SSR server example and links to the hotUpdate hook docs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/guide/ssr.md
Comment on lines +123 to +127
for (const mod of modules) {
if (mod.id == null) continue
const clientModule =
server.environments.client.moduleGraph.getModuleById(mod.id)
if (clientModule != null) continue
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.

SSR Page Reload does not refresh page on the client after upgrading to Vite 6

2 participants