vite-errors-dependency

vite-errors-dependency is a skill for Claude Code from OpenAEC-Foundation/OpenAEC-Workspace-Composer. It costs 124 tokens per session (2,249 once invoked), scanned C, original, MIT.

A troubleshooting guide for Vite dependency pre-bundling, the development step that prepares installed packages for browser use. It covers CommonJS and ES modules, cache problems, dependency resolution, and development startup issues.

In plain words
What is it for?
Use it when Vite reports dependency or pre-bundling errors, when linked monorepo packages fail in development, or when clearing and rebuilding the Vite cache is needed.
Why use it?
It helps diagnose broken imports, stale cached packages, and configuration choices that prevent dependencies from loading in the browser.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions Claude Code.

Good fit Use it when Vite reports dependency or pre-bundling errors, when linked monorepo packages fail in development, or when clearing and rebuilding the Vite cache is needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add OpenAEC-Foundation/OpenAEC-Workspace-Composer --skill vite-errors-dependency
Clone the repo
git clone --depth 1 https://github.com/OpenAEC-Foundation/OpenAEC-Workspace-Composer

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for vite-errors-dependency

README.md
[![agentmods](https://agentmods.dev/badge/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency/github.svg)](https://agentmods.dev/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency)
Your own site
<a href="https://agentmods.dev/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency"><img src="https://agentmods.dev/badge/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for vite-errors-dependency

Your own site · 80×15
<a href="https://agentmods.dev/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency"><img src="https://agentmods.dev/badge/skills/openaec-foundation/openaec-workspace-composer/vite-errors-dependency.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 124 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,249 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00124 $0.02249
Opus 5.5 $0.00050 $0.00900
Sonnet 5.5 $0.00025 $0.00450
Haiku 4.5 $0.00012 $0.00225

Measured 3mo ago against content hash d99397ffd653, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

vite-errors-dependency scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf node_modules/.vite
.claude/skills/vite/vite-errors/vite-errors-dependency/SKILL.md · 216 lines

How it starts

The opening of the file, as written. The whole thing — 216 lines — stays where its author put it; the contents beside it link to each section on GitHub.

vite-errors-dependency

Quick Reference

Pre-Bundling Overview

Vite pre-bundles dependencies in dev mode ONLY. It converts CJS/UMD packages to ESM and collapses large dependency trees into single modules. The cache lives at node_modules/.vite.

Version Pre-Bundling Engine Config Key for Engine Options
Vite 5 esbuild optimizeDeps.esbuildOptions
Vite 6–7 esbuild optimizeDeps.esbuildOptions
Vite 8 Rolldown optimizeDeps.rolldownOptions

NEVER assume pre-bundling affects production builds. Production uses Rollup (v5–v7) or Rolldown (v8) natively with @rollup/plugin-commonjs or built-in CJS support.

Critical Warnings

NEVER exclude a CJS dependency from pre-bundling via optimizeDeps.exclude. The browser cannot load CommonJS modules natively. Excluding a CJS package breaks module resolution at runtime.

NEVER edit files inside node_modules/ without also clearing the Vite cache (node_modules/.vite) and using --force. The browser aggressively caches pre-bundled deps with max-age=31536000,immutable.

ALWAYS add linked monorepo dependencies that do NOT export ESM to optimizeDeps.include. Vite skips pre-bundling for linked deps by default, assuming they are ESM source code.

ALWAYS restart the dev server with --force after modifying linked dependency source code in a monorepo.


Debugging Flowchart

Dev server error or unexpected behavior with a dependency?
│
├─ Error: "Failed to resolve import" or "does not provide an export named"
│  ├─ Is the package CJS-only?
│  │  ├─ YES → Is it in optimizeDeps.exclude?
│  │  │  ├─ YES → REMOVE it from exclude. CJS MUST be pre-bundled.
│  │  │  └─ NO  → Add to optimizeDeps.include explicitly.
│  │  └─ NO (ESM) → Check package.json "exports" field for correct conditions.
│  │
│  └─ Is it a monorepo linked dep?
│     ├─ Does it export ESM? → No action needed (Vite treats as source).
│     └─ Does it export CJS? → Add to optimizeDeps.include.
│
├─ Error: "Outdated pre-bundle" or stale module content
│  ├─ Did you manually edit node_modules/?
│  │  ├─ YES → Run: vite --force AND clear browser cache.
│  │  └─ NO  → Delete node_modules/.vite, restart dev server.
│  └─ Check: Did lockfile, vite.config, NODE_ENV, or patches change?
│     └─ YES → Vite should auto-invalidate. If not, run: vite --force.
│
├─ Slow dev server startup (many HTTP requests)
│  ├─ Check Network tab: hundreds of requests to one dependency?
│  │  └─ YES → Add that dependency to optimizeDeps.include.
│  │     Example: lodash-es triggers 600+ module requests without pre-bundling.
│  └─ Check: Are there undiscovered deps from plugin transforms?
│     └─ YES → Add to optimizeDeps.include (auto-discovery misses these).
│
└─ Import works in dev but fails in production (or vice versa)
   └─ Pre-bundling is dev-only. Production uses a different CJS handling path.
      Check build output for CJS interop issues separately.

Read the full file on GitHub · 216 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 216 lines · 124 tokens per session scan C d99397ffd653

Subscribe to this mod's changes

vite-errors-dependency is a skill published in the GitHub repository OpenAEC-Foundation/OpenAEC-Workspace-Composer (8 stars, last pushed 2mo ago), licensed MIT. It adds 124 tokens to every session and 2,249 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

vite-errors-dependency compared with skills from other repositories

vite-errors-dependency next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
vite-errors-dependencyOpenAEC-Foundation/OpenAEC-Workspace-ComposerSkill82mo agoMITC124Claude Code
aios-arch-healthArchSightLabs/archsight-aiosSkill372mo agoApache-2.0A137Claude Code, Codex
aios-execArchSightLabs/archsight-aiosSkill372mo agoApache-2.0A54Claude Code, Codex
rest-graphql-debugandrooAGI/starnetSkill2.0ktodayMITA45Claude Code, Codex
ha-logsshiwenwen/hope-agentSkill1.9kyesterdayMITA183Claude Code, Codex
ha-self-diagnosisshiwenwen/hope-agentSkill1.9kyesterdayMITA114Claude Code
read-only-investigationSyngnat/GoNaviSkill2.1ktodayApache-2.0A0Claude Code, Codex