Registry / testing / wdio-vite-service

wdio-vite-service

JSON →
library2.1.1jsnpmunverified

WebdriverIO service that automatically starts a Vite dev server before tests and sets the baseUrl to point to the application. Version 2.1.1 supports WebdriverIO v9 and Node.js >=18. It integrates seamlessly with Vite-based frameworks like Remix and provides options for custom config file, root directory, mode, and log level. The service is actively maintained with a release cadence of several releases per year, and it ships TypeScript definitions.

npm install wdio-vite-service
INSTALL
IMPORT
SIG · WDIO-VITE-SERVICE
W
wdio-vite-service
testingjavascriptv2.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

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

config
export const config = { services: ['vite'] };
services: [[require('wdio-vite-service'), {}]]
The service is registered as 'vite' (string), not by importing the module. Use string reference in wdio.conf.js.
ViteServiceOptions
import type { ViteServiceOptions } from 'wdio-vite-service';
Type import for service options. Available only in TypeScript environments.
default
import ViteService from 'wdio-vite-service';
import { ViteService } from 'wdio-vite-service';
The package exports a default class. Named import ViteService does not exist; use default import.

Registers the vite service with custom config, then uses the baseUrl to navigate and assert in tests.

// wdio.conf.js import { config } from '@wdio/types'; export const config: config.Testrunner = { // ... services: [ ['vite', { configFile: './vite.config.ts', configRoot: process.cwd(), mode: 'development', logLevel: 'info' }] ], // ... }; // In a test file (e.g., test.e2e.ts): await browser.url('/'); await expect(browser).toHaveTitle('My App'); await expect($('aria/Login')).toBePresent();
Debug
Known issues
breakingVersion 2.0.0 drops support for Node.js <18. You must upgrade Node.js to v18+.
fix
Update Node.js to version 18 or higher.
affects: >=2.0.0
breakingVersion 2.0.0 supports only WebdriverIO v9. Remove compatibility with WDIO v8.
fix
Upgrade WebdriverIO to version 9 or later.
affects: >=2.0.0
deprecatedUsing CommonJS require() to load the service is discouraged; ESM is recommended.
fix
Use ESM imports (e.g., import ViteService from 'wdio-vite-service') or use string 'vite' in services list.
affects: >=2.0.0
gotchaThe service sets baseUrl automatically. If you override baseUrl in config, your override might be clobbered.
fix
Do not set baseUrl manually when using the vite service; let the service manage it.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'wdio-vite-service'
Package not installed or not in node_modules
fix
Run `npm install wdio-vite-service --save-dev` or `pnpm add -D wdio-vite-service`
TypeError: services[0] is not iterable
Service configured incorrectly (e.g., using { } instead of ['vite', options])
fix
Use array syntax: services: [['vite', { configFile: './vite.config.ts' }]]
Error: Failed to start Vite server
Vite config file not found or invalid
fix
Ensure the path in configFile option is correct and the file exports a valid Vite config.
Upgrade
Version history
2.1.1latest on npm
Audit
Dependencies
@wdio/typesrequiredPeer dependency required for TypeScript types
webdriveriorequiredPeer dependency providing the WebdriverIO test runner
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
wdio-vite-service — npm install wdio-vite-service · libregistry