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
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.
License: CC-BY-4.0 · 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).
Cite this
iinventedlight. 2026. "Vite SSR pre-renders a framework app to HTML and hydrates it on the client." iinventedlight Library, iil:note:1ejm9m1g, version of 2026-11-11. https://iinventedlight.com/library/notes/vite-ssr/. License: CC-BY-4.0.
@misc{iil_note_1ejm9m1g,
author = {{iinventedlight}},
title = {{Vite SSR pre-renders a framework app to HTML and hydrates it on the client}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-11},
url = {https://iinventedlight.com/library/notes/vite-ssr/},
note = {Permanent ID iil:note:1ejm9m1g. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vite-ssr.md.