The `vike-server` package historically provided utilities for integrating Vike with various Node.js server frameworks like Express.js or Hono, enabling server-side rendering (SSR), hot module replacement (HMR) for server code, and zero-configuration setups with Vite. It aimed to transpiles server code with Vite, eliminating the need for separate tools like `ts-node`. However, `vike-server` (current version 1.0.25) is now deprecated. Vike applications should instead leverage the built-in `+server.js` convention for flexible server integration or migrate to `vike-photon` for advanced edge and serverless deployments. Vike itself, the meta-framework that `vike-server` extended, is currently in a stable 1.x.x release series, focusing on a robust, unopinionated foundation for building web applications with SSR, routing, and data loading atop Vite, and is known for its stable core and gradual evolution.
npm install vike-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates how `vike-server` was typically used to integrate Vike with an Express.js server, including its now-deprecated `apply` and `serve` functions. This setup enables SSR and asset serving for Vike applications.
Remove `vike-server` from dependencies. For server integration, implement `+server.js` files as documented on vike.dev, or install and configure `vike-photon` (e.g., `npm install vike-photon @photonjs/express`). Refer to the official Vike migration guides for `+server` and `vike-photon`.
Ensure you are using `vike-server/express` (if staying on `vike-server`) or, preferably, migrate to `vike-photon` which provides framework-specific packages like `@photonjs/express`.
Migrate your project to use the 'plus files' convention. For example, rename `index.page.js` to `+Page.js` and `_default.page.server.js` to `+onRenderHtml.js` (or similar for other hooks).
Upgrade your Node.js environment to version 20 or higher. Consider using `nvm` or `volta` to manage Node.js versions.
Verify `vike-server` is listed in your `package.json` and installed. If you intend to use `vike-photon` or `+server.js`, ensure `vike-server` is uninstalled and your server entry point is updated according to the Vike migration guides for `+server` or `vike-photon`.
Ensure `vike-server` (or its replacement `vike-photon`/`+server.js`) is correctly initialized and applied to your server framework. Check Vike's documentation on `pageContext` and server integration for the correct setup, especially if you recently upgraded Vike or are migrating away from `vike-server`.