Zova Vite
raw JSON → 1.1.19 verified Mon Apr 27 auth: no javascript
Zova Vite is a Vite plugin/framework integration for Zova, a TypeScript-first Node.js framework. Version 1.1.19 is the current stable release. It provides a streamlined development experience with hot module replacement (HMR), TypeScript support out of the box, and tight integration with Vite's build pipeline. Unlike generic Vite setups, it offers opinionated defaults for Zova projects, reducing configuration overhead. The plugin is actively maintained with frequent updates aligned to Vite's release cadence. Key differentiators include zero-config setup for Zova apps, automatic route generation, and built-in support for server-side rendering (SSR) when used with Zova.
Common errors
error Cannot find module 'zova-vite' or its corresponding type declarations. ↓
cause Package not installed or missing type definitions.
fix
Run
npm install zova-vite --save-dev and ensure you have @types/node if needed. error TypeError: (0 , zova_vite_1.zovaVitePlugin) is not a function ↓
cause Using require() with ESM-only package.
fix
Change to
import { zovaVitePlugin } from 'zova-vite' and ensure project uses ESM. error Uncaught ReferenceError: defineConfig is not defined ↓
cause Missing import for defineConfig.
fix
Add
import { defineConfig, zovaVitePlugin } from 'zova-vite'. error [vite] Internal server error: Unexpected token 'export' ↓
cause Using ESM syntax in a CommonJS module.
fix
Set
"type": "module" in package.json or rename file to .mts. Warnings
breaking zova-vite v1.0 dropped CommonJS support; require() will fail. ↓
fix Switch to ESM imports or use dynamic import() if in CJS context.
deprecated The 'enableSSR' option was renamed to 'ssr' in v1.1.0. ↓
fix Use `ssr: true` instead of `enableSSR: true`.
gotcha When using TypeScript, ensure 'moduleResolution' is set to 'bundler' or 'node16' in tsconfig.json. ↓
fix Set `moduleResolution: 'bundler'` or `'node16'`.
deprecated The default export has been removed; use named export 'zovaVitePlugin'. ↓
fix Replace `import ZovaVite from 'zova-vite'` with `import { zovaVitePlugin } from 'zova-vite'`.
gotcha During SSR, avoid using window/document in your plugin config. ↓
fix Wrap client-side code inside `if (typeof window !== 'undefined')` or use `onSSR` option.
Install
npm install zova-vite yarn add zova-vite pnpm add zova-vite Imports
- zovaVitePlugin wrong
const zovaVitePlugin = require('zova-vite')correctimport { zovaVitePlugin } from 'zova-vite' - ZovaViteOptions wrong
import { ZovaViteOptions } from 'zova-vite'correctimport type { ZovaViteOptions } from 'zova-vite' - defineConfig wrong
import { defineConfig as dc } from 'zova-vite'correctimport { defineConfig } from 'zova-vite'
Quickstart
// vite.config.ts
import { defineConfig, zovaVitePlugin } from 'zova-vite';
export default defineConfig({
plugins: [
zovaVitePlugin({
ssr: true,
apiKey: process.env.ZOVA_API_KEY ?? ''
})
]
});