{"id":14232,"library":"vike","title":"Vike - Composable Vite-powered SSR Framework","description":"Vike is a highly flexible and unopinionated Server-Side Rendering (SSR) framework, powered by Vite, designed to build advanced web applications. Unlike monolithic frameworks such as Next.js or Nuxt, Vike positions itself as a 'composable' alternative, allowing developers to integrate their preferred frontend libraries (React, Vue, Solid, Svelte, etc.) and dictate their own data fetching and routing strategies. The current stable version is `0.4.258`, reflecting active and continuous development. While its predecessor, `vite-plugin-ssr`, stabilized around `0.1.0` in 2021, the `vike` package continues to evolve with frequent releases, indicating a commitment to rapid iteration and improvement. Its core differentiator lies in providing the foundational tooling for SSR with Vite, empowering developers with choice and control rather than enforcing a rigid application structure, making it suitable for complex or highly customized projects.","status":"active","version":"0.4.258","language":"javascript","source_language":"en","source_url":"https://github.com/vikejs/vike","tags":["javascript","vite-plugin","ssr","vite","react","vue","solid","next","remix","typescript"],"install":[{"cmd":"npm install vike","lang":"bash","label":"npm"},{"cmd":"yarn add vike","lang":"bash","label":"yarn"},{"cmd":"pnpm add vike","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for applications utilizing React's streaming capabilities, enabling faster perceived load times.","package":"react-streaming","optional":true},{"reason":"Core build tool and development server, Vike is a Vite plugin.","package":"vite","optional":false}],"imports":[{"note":"The Vike plugin is a default export from the 'vike/plugin' entry point and is used in your Vite configuration file.","wrong":"import { vike } from 'vike'","symbol":"vike","correct":"import vike from 'vike/plugin'"},{"note":"This is a TypeScript type import for the `pageContext` object, providing full type safety for server-side and client-side page context data.","wrong":"import { PageContext } from 'vike/types'","symbol":"PageContext","correct":"import type { PageContext } from 'vike/types'"},{"note":"Used programmatically on the server-side to render a Vike page, typically in a custom server setup (e.g., Express).","wrong":"import { renderPage } from 'vike'","symbol":"renderPage","correct":"import { renderPage } from 'vike/server'"}],"quickstart":{"code":"import { defineConfig } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport vike from 'vike/plugin';\n\n// vite.config.ts\nexport default defineConfig({\n  plugins: [react(), vike({ prerender: true })]\n});\n\n// src/pages/index/+Page.tsx\nimport React from 'react';\n\nexport default function Page() {\n  return (\n    <>\n      <h1>Hello Vike!</h1>\n      <p>This is a Vike application with React.</p>\n    </>\n  );\n}\n\n// src/pages/index/+data.ts (optional, for server-side data fetching)\nexport type Data = { message: string };\nexport async function data(): Promise<Data> {\n  return { message: 'Data fetched on server' };\n}\n","lang":"typescript","description":"Sets up a basic Vike application with React, demonstrating the Vite configuration, a simple page component, and optional server-side data fetching."},"warnings":[{"fix":"Migrate `vite-plugin-ssr` to `vike` in `package.json` dependencies and update `import { something } from 'vite-plugin-ssr'` to `import { something } from 'vike'` or `import vike from 'vike/plugin'`.","message":"The package name was changed from `vite-plugin-ssr` to `vike`. Existing applications must update their `package.json` and all import paths.","severity":"breaking","affected_versions":"<0.1.0"},{"fix":"Ensure your development and deployment environments are running Node.js version 20.19.0 or higher. Use a Node.js version manager like `nvm` to switch versions if necessary.","message":"Vike requires Node.js version `>=20.19.0`. Running with older Node.js versions will result in startup errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Consult the Vike and Vite documentation for best practices in configuring `vite.config.ts`. Pay close attention to `ssr.external` and `resolve.alias` settings.","message":"Vike relies heavily on Vite's module resolution. Ensure your Vite configuration is correct, especially regarding aliases and server-side externalization, to avoid build or runtime issues.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always refer to the official Vike documentation (`vike.dev`) for the current structure and available properties of `pageContext` for your specific Vike version. Use TypeScript types from `vike/types` for compile-time validation.","message":"The `pageContext` object has evolved significantly over versions, with properties like `pageContext.pageExports` becoming available on the client-side only in later versions. Relying on undocumented or older `pageContext` structures can lead to breakage.","severity":"breaking","affected_versions":"<0.1.2"},{"fix":"Ensure all server-side data fetching in `+data.js` or `+data.ts` files return promises that resolve before the page is rendered. Leverage `async/await` appropriately.","message":"When prerendering (`prerender: true` in `vike()` plugin options), Vike expects all data fetching to be synchronous or properly awaited during the build process. Asynchronous operations that are not handled can lead to incomplete prerendered output.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.0':87 '0.4.258':72 '2021':89 'activ':74 'advanc':27 'allow':45 'altern':44 'applic':29,131 'around':86 'build':26 'choic':123 'commit':101 'complex':137 'compos':2,43 'continu':76,93 'control':125 'core':108 'current':68 'custom':140 'data':62 'design':24 'develop':46,77,121 'dictat':59 'differenti':109 'empow':120 'enforc':128 'etc':57 'evolv':95 'fetch':63 'flexibl':12 'foundat':114 'framework':7,20,32 'frequent':97 'frontend':51 'high':11,139 'improv':106 'indic':99 'integr':48 'iter':104 'javascript':142 'librari':52 'lie':110 'make':133 'monolith':31 'next':151 'next.js':35 'nuxt':37 'packag':92 'plugin':83,145 'posit':39 'power':5,21 'predecessor':80 'prefer':50 'project':141 'provid':112 'rapid':103 'rather':126 'react':53,148 'reflect':73 'releas':98 'remix':152 'render':18 'rigid':130 'rout':65 'server':16 'server-sid':15 'side':17 'solid':55,150 'ssr':6,19,84,117,146 'stabil':85 'stabl':69 'strategi':66 'structur':132 'suitabl':135 'svelt':56 'tool':115 'typescript':153 'unlik':30 'unopinion':14 'version':70 'vike':1,8,38,91 'vite':4,23,82,119,144,147 'vite-plugin':143 'vite-plugin-ssr':81 'vite-pow':3 'vue':54,149 'web':28","created_at":"2026-04-20T01:58:38.179561+00:00","updated_at":"2026-04-20T01:58:38.179561+00:00","problems":[{"fix":"Ensure `vike` is installed and the import statement is `import vike from 'vike/plugin'` in `vite.config.ts`.","cause":"Incorrect import path for the Vike Vite plugin, or an outdated package name.","error":"Error: Cannot find module 'vike/plugin'"},{"fix":"Convert `require()` statements to `import` statements. Ensure your `package.json` specifies `\"type\": \"module\"` or files use `.mjs` or `.ts` extensions for ESM.","cause":"Attempting to use CommonJS `require()` syntax in an ESM-only context (e.g., in a Vite configuration file or a Vike page file).","error":"ReferenceError: require is not defined in ES module scope"},{"fix":"Upgrade your Node.js installation to version 20.19.0 or newer. Consider using a tool like `nvm` for managing Node.js versions.","cause":"The installed Node.js version does not meet Vike's minimum requirements.","error":"Vite plugin 'vike' requires Node.js version >=20.19.0"},{"fix":"Update Vite to version 6.3.0 or higher. Run `npm install vite@latest` or `yarn add vite@latest`.","cause":"The installed version of Vite is older than what Vike requires.","error":"Error: Peer dependency 'vite' (>=6.3.0) not met for 'vike'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"vike","cli_version":null,"type":"library","homepage":"https://vike.dev","github":"https://github.com/vikejs/vike","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/vike","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-18","install_tag":null}}