Registry / devops / vite-ssr-vue

vite-ssr-vue

JSON →
library1.1.8jsnpmunverified

Vite 2 utility for Vue 3 server-side rendering with fast HMR, teleport support, and flexible configuration. Latest version 1.1.8 (last release 2022) is stable but in maintenance mode. It provides a seamless SSR setup for Vue 3 apps using Vite, with hooks like created, mounted, and rendered for customization. Key differentiators: small library size, compatibility with Vite plugins, and support for preload/prefetch. However, it requires multiple peer dependencies (@vue/server-renderer, @vueuse/head, node-html-parser, @rollup/plugin-replace) and has a breaking change for Vite >2.7.9 requiring separate client/server entry points. Alternatives like vike (formerly vite-plugin-ssr) are more actively maintained.

npm install vite-ssr-vue
INSTALL
IMPORT
SIG · VITE-SSR-VUE
V
vite-ssr-vue
devopsjavascriptv1.1.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ssr (client)
import ssr from 'vite-ssr-vue/client'
import ssr from 'vite-ssr-vue'
For Vite >2.7.9, use separate client/server entry points. The default import is deprecated.
ssr (server)
import ssr from 'vite-ssr-vue/server'
import ssr from 'vite-ssr-vue'
For Vite >2.7.9, use separate client/server entry points.
createSsr (unified)
import createSsr from 'vite-ssr-vue'
import createSsr from 'vite-ssr-vue/plugin'
Only for Vite <=2.7.9. With Vite >2.7.9, use separate entry points.
plugin
import ssr from 'vite-ssr-vue/plugin'
import { ssr } from 'vite-ssr-vue'
Default export, not named. Used in vite.config.js for Vite <=2.7.9.

Shows two entry patterns: separate client/server for Vite >2.7.9 vs unified with plugin for Vite <=2.7.9.

// entry-client.ts (Vite >2.7.9) import ssr from 'vite-ssr-vue/client'; import App from './App.vue'; export default ssr(App); // entry-server.ts (Vite >2.7.9) import ssr from 'vite-ssr-vue/server'; import App from './App.vue'; export default ssr(App); // vite.config.js (for Vite <=2.7.9) import vue from '@vitejs/plugin-vue'; import ssr from 'vite-ssr-vue/plugin'; export default { plugins: [ssr(), vue()], }; // main.ts (for Vite <=2.7.9) import createSsr from 'vite-ssr-vue'; import App from './App.vue'; export default createSsr(App);
Debug
Known issues
breakingVite >2.7.9 requires separate client and server entry points; the unified import pattern no longer works.
fix
Use 'import ssr from "vite-ssr-vue/client"' and 'import ssr from "vite-ssr-vue/server"' instead of a single main.ts entry.
affects: >=1.0.0
deprecatedThe unified entry point 'import createSsr from "vite-ssr-vue"' is deprecated for Vite >2.7.9.
fix
Switch to separate client/server entry points if using Vite >2.7.9.
affects: >=1.0.0 <1.1.0
gotchaMultiple peer dependencies are required: @vue/server-renderer, @vueuse/head, node-html-parser, @rollup/plugin-replace. Missing them causes runtime errors.
fix
Install all peer dependencies: yarn add @vue/server-renderer @vueuse/head node-html-parser @rollup/plugin-replace
affects: >=1.0.0
gotchaWhen using the unified entry point, the plugin automatically changes the alias for SSR. Do not manually alias 'vue' or 'vue-router' during SSR.
fix
Remove any manual alias configuration for SSR in Vite config.
affects: <1.0.0
Errors
Common errors & fixes
Cannot find module 'vite-ssr-vue/client'
Using separate entry points with an older version of the package that does not export 'client' or 'server'.
fix
Upgrade to version 1.1.0 or later: npm install vite-ssr-vue@latest
Uncaught Error: [vite-ssr-vue] You must provide a root component.
Missing or incorrect App component import.
fix
Ensure App.vue is correctly imported and passed to ssr() as shown in the quickstart.
TypeError: createSsr is not a function
Using default import from 'vite-ssr-vue' but the package version uses separate entry points.
fix
Use 'import ssr from "vite-ssr-vue/client"' and 'import ssr from "vite-ssr-vue/server"' instead.
Upgrade
Version history
1.1.8latest on npm
Audit
Dependencies
@vue/server-rendererrequiredRequired for Vue SSR rendering
@vueuse/headrequiredRequired for managing head tags during SSR
node-html-parserrequiredUsed for HTML parsing in SSR
@rollup/plugin-replacerequiredUsed for replacing variables during build
Agent activity
2 hits · last 30 days
node
2
Resources
vite-ssr-vue — npm install vite-ssr-vue · libregistry