Registry /
devops / hot-reload-extension-vite
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
muslnode 18–223 runs
build_error
glibcnode 18–223 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ import hotReloadExtension from 'hot-reload-extension-vite'
✗ const hotReloadExtension = require('hot-reload-extension-vite')
ESM-only plugin; CJS require will fail because package is type: module and exports ESM.
SidePanelOptions
✓ import type { SidePanelOptions } from 'hot-reload-extension-vite'
✗ import { SidePanelOptions } from 'hot-reload-extension-vite'
Type import only; runtime import will cause error because SidePanelOptions is a type, not a value.
HotReloadConfig
✓ import type { HotReloadConfig } from 'hot-reload-extension-vite'
✗ import { HotReloadConfig } from 'hot-reload-extension-vite'
Similarly, use type import for config type.
Minimal Vite config for Chrome extension hot reload with background and side panel.
// vite.config.ts
import { defineConfig } from 'vite';
import hotReloadExtension from 'hot-reload-extension-vite';
export default defineConfig({
plugins: [
hotReloadExtension({
log: true,
backgroundPath: 'src/background.ts',
sidePanel: {
path: 'src/sidePanel.ts',
htmlPath: 'public/sidePanel.html'
}
})
],
build: {
rollupOptions: {
input: {
background: 'src/background.ts',
sidePanel: 'src/sidePanel.html'
}
}
}
});
// Run build with watch mode:
// NODE_ENV=development npx vite build --watch
Errors
Common errors & fixes
Error: Cannot find module 'hot-reload-extension-vite'
Package not installed as dev dependency.
fixnpm install hot-reload-extension-vite -D
TypeError: hotReloadExtension is not a function
Using CommonJS require() instead of ESM import.
fixChange require('hot-reload-extension-vite') to import hotReloadExtension from 'hot-reload-extension-vite' in a module context. Error: 'backgroundPath' is required
Missing backgroundPath option in plugin configuration.
fixAdd backgroundPath pointing to your background script, e.g., backgroundPath: 'src/background.ts'.
WebSocket connection to 'ws://localhost:8080/' failed
Port 8080 already in use or WebSocket server not started (NODE_ENV not development).
fixSet NODE_ENV=development and/or change port via HOT_RELOAD_EXTENSION_VITE_PORT env variable.
Audit
Dependencies
viterequiredPeer dependency required as a Vite plugin