Skip to content

Troubleshooting

Use this page when something in Vite+ is not behaving the way you expect.

WARNING

Vite+ is still in alpha. We are making frequent changes, adding features quickly, and we want feedback to help make it great.

Supported Tool Versions

Vite+ expects modern upstream tool versions.

  • Vite 8 or newer
  • Vitest 4.1 or newer

If you are migrating an existing project and it still depends on older Vite or Vitest versions, upgrade those first before adopting Vite+.

vp check does not run type-aware lint rules or type checks

  • Confirm that lint.options.typeAware and lint.options.typeCheck are enabled in vite.config.ts
  • Check whether your tsconfig.json still uses compilerOptions.baseUrl

The Oxlint type checker path powered by tsgolint does not support baseUrl. vp migrate and vp lint --init try to run the vp dlx @andrewbranch/ts5to6 --fixBaseUrl . fix before enabling type-aware linting. If that fix fails or is declined, Vite+ skips typeAware and typeCheck.

VS Code extension does not read vite.config.ts

If VS Code has multiple folders open, the shared Oxc language server may pick a different workspace than expected. That can make it look like vite.config.ts support is missing.

  • Confirm the extension is using the intended workspace.

vp build does not run my build script

Unlike package managers, built-in commands cannot be overwritten. If you are trying to run a package.json script use vp run build instead.

For example:

  • vp build always runs the built-in Vite build
  • vp test always runs the built-in Vitest command
  • vp run build and vp run test run package.json scripts instead

INFO

You can also run custom tasks defined in vite.config.ts and migrate away from package.json scripts entirely.

Staged Checks and Commit Hooks

If vp staged fails or your pre-commit hook does not run:

  • make sure vite.config.ts contains a staged block
  • run vp config to install hooks
  • check whether hook installation was skipped intentionally through VITE_GIT_HOOKS=0

A minimal staged config looks like this:

vite.config.ts
ts
import { defineConfig } from 'vite-plus';

export default defineConfig({
  staged: {
    '*': 'vp check --fix',
  },
});

Slow config loading caused by heavy plugins

When vite.config.ts imports heavy plugins at the top level, every import is evaluated eagerly, even for commands like vp lint or vp fmt that don't need those plugins. This can make config loading noticeably slow.

Use lazyPlugins to wrap plugin loading. Plugins are only loaded for commands that need them (dev, build, test, preview), and skipped for everything else:

vite.config.ts
ts
import { defineConfig, lazyPlugins } from 'vite-plus';
import myPlugin from 'vite-plugin-foo';

export default defineConfig({
  plugins: lazyPlugins(() => [myPlugin()]),
});

For heavy plugins that should be lazily imported, combine with dynamic import():

vite.config.ts
ts
import { defineConfig, lazyPlugins } from 'vite-plus';

export default defineConfig({
  plugins: lazyPlugins(async () => {
    const { default: heavyPlugin } = await import('vite-plugin-heavy');
    return [heavyPlugin()];
  }),
});

Asking for Help

If you are stuck, please reach out:

  • Discord for real-time discussion and troubleshooting help
  • GitHub for issues, discussions, and bug reports

When reporting a problem, please include:

  • The full output of vp env current and vp --version
  • The package manager used by the project
  • The exact steps needed to reproduce the problem and your vite.config.ts
  • A minimal reproduction repository or runnable sandbox