---
source: https://iinventedlight.com/library/notes/vite-ssr.md
title: "Vite SSR pre-renders a framework app to HTML and hydrates it on the client"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (vitejs/vite docs and source); prose restates cited source lines in own words"
license_family: vite-mit
attribution: "Summary by iinventedlight (AI-assisted). Sources: Vite docs and Vite source (vitejs/vite), MIT. Notices: Vite documentation and source (vitejs/vite): Copyright (c) 2019-present, VoidZero Inc. and Vite contributors; MIT (https://raw.githubusercontent.com/vitejs/vite/main/LICENSE)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-11
status: published
approved_by: "Cole Withington, 2026-11-11 09:59 PT, Librarian chat widget t34s5: \"Yes, publish all 25 Angular and Vite drafts\""
checked_on: 2026-11-11
as_of: 2026-11-11
confidence: medium
untested: "No project was run for this note; only the fetched documentation and source files were read."
category: coding-references
topic_area: "code-web: Vite SSR"
tags: [vite, ssr, hydration, node]
client: Librarian
sources:
  - id: S1
    title: "Server-Side Rendering"
    publisher: Vite docs
    url: https://vite.dev/guide/ssr
    accessed: 2026-11-11
    license: "MIT"
  - id: S2
    title: "SSR module loader"
    publisher: Vite source
    url: https://github.com/vitejs/vite/blob/main/packages/vite/src/node/ssr/ssrModuleLoader.ts
    accessed: 2026-11-11
    license: "MIT"
---
# Vite's SSR API is a low-level way to pre-render and hydrate an app

**Answer:** In Vite, SSR means a front-end framework such as React, Preact, Vue, or Svelte can run the same application in Node.js, pre-render it to HTML, and then hydrate it on the client. If you want to hook Vite into a traditional server framework, use the Backend Integration guide instead.

The SSR guide is a low-level API meant for library and framework authors. Application authors should first look at higher-level SSR plugins and tools. Vite provides built-in SSR support, and `create-vite-extra` has example setups.

## In source

ssrLoadModule takes a url, a ViteDevServer, and an optional fixStacktrace flag, and returns a Promise of SSRModule. It requires the server's ssr environment to be a runnable environment. If that is not true, it throws. ssrFixStacktrace(e, environment.moduleGraph) runs when e.stack and fixStacktrace are set.

## See also

- [vite-cli](https://iinventedlight.com/library/notes/vite-cli/)
- [vite-plugins](https://iinventedlight.com/library/notes/vite-plugins/)

## Claims

- id: C1
  claim: SSR here means pre-rendering a framework app to HTML and hydrating it.
  source: S1
  evidence: "pre-rendering it to HTML, and finally hydrating it on the client."

- id: C2
  claim: The Vite SSR API is a low-level API for library and framework authors.
  source: S1
  evidence: "This is a low-level API meant for library and framework authors."

- id: C3
  claim: ssrLoadModule loads a module URL on a ViteDevServer.
  source: S2
  evidence: "export async function ssrLoadModule("

- id: C4
  claim: The ssr environment must be a runnable environment.
  source: S2
  evidence: "ssrLoadModule requires the 'ssr' environment to be a runnable environment."

## Sources

- [S1] Server-Side Rendering. Vite docs. https://vite.dev/guide/ssr . License: MIT. Accessed 2026-11-11.

- [S2] SSR module loader. Vite source. https://github.com/vitejs/vite/blob/main/packages/vite/src/node/ssr/ssrModuleLoader.ts . License: MIT. Accessed 2026-11-11.


License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources and notices: Vite documentation and source (vitejs/vite): Copyright (c) 2019-present, VoidZero Inc. and Vite contributors; MIT (https://raw.githubusercontent.com/vitejs/vite/main/LICENSE). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
