{"id":22975,"library":"wdio-vite-service","title":"WDIO Vite Service","description":"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.","status":"active","version":"2.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/webdriverio-community/wdio-vite-service","tags":["javascript","wdio","wdio-service","vite","vitejs","webdriverio","typescript"],"install":[{"cmd":"npm install wdio-vite-service","lang":"bash","label":"npm"},{"cmd":"yarn add wdio-vite-service","lang":"bash","label":"yarn"},{"cmd":"pnpm add wdio-vite-service","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for TypeScript types","package":"@wdio/types","optional":false},{"reason":"Peer dependency providing the WebdriverIO test runner","package":"webdriverio","optional":false}],"imports":[{"note":"The service is registered as 'vite' (string), not by importing the module. Use string reference in wdio.conf.js.","wrong":"services: [[require('wdio-vite-service'), {}]]","symbol":"config","correct":"export const config = { services: ['vite'] };"},{"note":"Type import for service options. Available only in TypeScript environments.","wrong":"","symbol":"ViteServiceOptions","correct":"import type { ViteServiceOptions } from 'wdio-vite-service';"},{"note":"The package exports a default class. Named import ViteService does not exist; use default import.","wrong":"import { ViteService } from 'wdio-vite-service';","symbol":"default","correct":"import ViteService from 'wdio-vite-service';"}],"quickstart":{"code":"// wdio.conf.js\nimport { config } from '@wdio/types';\n\nexport const config: config.Testrunner = {\n  // ...\n  services: [\n    ['vite', {\n      configFile: './vite.config.ts',\n      configRoot: process.cwd(),\n      mode: 'development',\n      logLevel: 'info'\n    }]\n  ],\n  // ...\n};\n\n// In a test file (e.g., test.e2e.ts):\nawait browser.url('/');\nawait expect(browser).toHaveTitle('My App');\nawait expect($('aria/Login')).toBePresent();","lang":"typescript","description":"Registers the vite service with custom config, then uses the baseUrl to navigate and assert in tests."},"warnings":[{"fix":"Update Node.js to version 18 or higher.","message":"Version 2.0.0 drops support for Node.js <18. You must upgrade Node.js to v18+.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade WebdriverIO to version 9 or later.","message":"Version 2.0.0 supports only WebdriverIO v9. Remove compatibility with WDIO v8.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use ESM imports (e.g., import ViteService from 'wdio-vite-service') or use string 'vite' in services list.","message":"Using CommonJS require() to load the service is discouraged; ESM is recommended.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Do not set baseUrl manually when using the vite service; let the service manage it.","message":"The service sets baseUrl automatically. If you override baseUrl in config, your override might be clobbered.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run `npm install wdio-vite-service --save-dev` or `pnpm add -D wdio-vite-service`","cause":"Package not installed or not in node_modules","error":"Error: Cannot find module 'wdio-vite-service'"},{"fix":"Use array syntax: services: [['vite', { configFile: './vite.config.ts' }]]","cause":"Service configured incorrectly (e.g., using { } instead of ['vite', options])","error":"TypeError: services[0] is not iterable"},{"fix":"Ensure the path in configFile option is correct and the file exports a valid Vite config.","cause":"Vite config file not found or invalid","error":"Error: Failed to start Vite server"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}