vite
Vite Error Codes
Error codes thrown by the Vite dev server and build pipeline. They appear as the code property on Error objects and identify the precise failure within Vite's module resolution, dependency pre-bundling, or plugin system.
7 codes
references vitejs.dev/guide/troubleshootinggithub.com/vitejs/vite/blob/main/packages/vite/src/node/optimizer/index.ts
· All codes 7 codes
- ERR_BLOCKED_DEPENDENCY Blocked Dependency A dependency was blocked from loading by Vite's dev server, typically because it matched a pattern in the `server.fs.deny` config or falls outside the allowed file-system boundary set by `server.fs.allow`. Adjust `server.fs.allow` to include the path, or move the file inside the project root.
- ERR_FILE_NOT_FOUND_IN_OPTIMIZED_DEP_INFO File Not Found in Optimized Dependency Info Vite's optimizer metadata references a file that no longer exists on disk. This usually happens after deleting `node_modules` without clearing the Vite cache, or after a partial install. Run `vite --force` or delete the `node_modules/.vite` directory and restart the dev server.
- ERR_INVALID_IMPORT Invalid Import Vite detected an import that violates ESM rules or crosses a boundary that Vite enforces. Common triggers include importing a server-only module into client code, using `require()` in an ESM context, or importing a package that only provides a CommonJS build without an ESM wrapper. Use dynamic `import()` or configure `ssr.noExternal` as appropriate.
- ERR_LOAD_URL Failed to Load URL Vite's dev server could not load a module at the requested URL. The original cause is attached as error.cause and usually points to a missing file, an unresolvable bare import, or a plugin that returned an unexpected result. Check that the import path is correct and that all necessary plugins are configured.
- ERR_OPTIMIZE_DEPS_PROCESSING_ERROR Dependency Pre-Bundling Failed Vite's esbuild-based dependency optimizer failed to pre-bundle one or more dependencies. Usually caused by a malformed package, a CJS/ESM interop problem, or a dependency that contains browser-incompatible code. Check the nested error message for the specific package and cause.
- ERR_OUTDATED_OPTIMIZED_DEP Outdated Optimized Dependency A pre-bundled dependency changed after the optimizer finished, leaving the cached version stale. Vite detects this mid-request and triggers a full page reload to re-optimize. If the reload loop repeats, force-clear the cache with `vite --force` or delete `node_modules/.vite`.
- ERR_PLUGIN_ERROR Plugin Error A Vite plugin threw an error during the transform, load, or resolve phase. The plugin name and the original error are included in the message. Check the stack trace for the plugin responsible and consult that plugin's documentation or issue tracker.