davila7/claude-code-templates · warning
Warning: Error loading plugin ${pluginDir}
Error message
Warning: Error loading plugin ${pluginDir} What it means
Inside loadInstalledPlugins(), each installed plugin's plugin.json is read and parsed; this per-plugin warning fires when one plugin's directory or plugin.json is unreadable/malformed while the rest keep loading. The outer list is preserved — only the offending plugin is skipped.
Source
Thrown at cli-tool/src/plugin-dashboard.js:221
const pluginJson = JSON.parse(await fs.readFile(pluginJsonPath, 'utf8'));
// Count components
const components = await this.countPluginComponents(pluginPath);
plugins.push({
name: pluginJson.name,
version: pluginJson.version || '1.0.0',
description: pluginJson.description || 'No description',
marketplace: marketplaceDir,
path: pluginPath,
components,
author: pluginJson.author,
homepage: pluginJson.homepage,
license: pluginJson.license
});
}
} catch (error) {
console.warn(chalk.yellow(`Warning: Error loading plugin ${pluginDir}`), error.message);
}
}
}
return plugins;
} catch (error) {
console.warn(chalk.yellow('Warning: Error loading plugins'), error.message);
return [];
}
}
async loadPluginsFromMarketplace(marketplacePath, marketplaceName) {
const plugins = [];
try {
const marketplaceJsonPath = path.join(marketplacePath, '.claude-plugin', 'marketplace.json');
const content = await fs.readFile(marketplaceJsonPath, 'utf8');
const marketplaceData = JSON.parse(content);View on GitHub (pinned to a0851ed10c)
Solutions
- Check ~/.claude/plugins/<pluginDir>/plugin.json exists and is valid JSON (`cat` it, or run it through a JSON validator).
- Delete or complete half-installed plugin folders.
- Reinstall the plugin from its marketplace to regenerate a valid manifest.
- Match required fields (name, version, description) as documented by the plugin schema.
Example fix
// before: plugin.json missing
{"name": "foo"}
// after: valid manifest at ~/.claude/plugins/foo/plugin.json
{
"name": "foo",
"version": "1.0.0",
"description": "...",
"author": "..."
} Defensive patterns
Strategy: validation
Validate before calling
const manifest = path.join(pluginDir, 'plugin.json'); if (!fs.existsSync(manifest)) continue; // skip pluginless folder const json = JSON.parse(fs.readFileSync(manifest, 'utf8'));
Type guard
const isPluginManifest = (v) => v != null && typeof v.name === 'string' && typeof v.version === 'string';
Try / catch
catch (e) { console.warn(`Skipping plugin ${pluginDir}:`, e.message); } Prevention
- Validate plugin.json with a schema before installing.
- Delete half-installed plugin folders.
- Pin to marketplace-installed plugins rather than manual copies.
When it happens
Trigger: A plugin directory in ~/.claude/plugins lacking plugin.json (ENOENT), a plugin.json with invalid JSON, or an unexpected schema (missing required fields causing downstream property access to throw) within the per-plugin try block.
Common situations: Manually copied plugin folders without a manifest, partially downloaded plugins, hand-edited plugin.json files with syntax errors, or plugins written for an older manifest schema.
Related errors
- Warning: Error counting components for plugin at ${pluginPat
- Warning: Error loading plugin permissions for ${plugin.name}
- Warning: Error loading plugin skills:
- Invalid session file - corrupted or not a Claude Code sessio
- Warning: Could not read settings file
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/616520115eab561b.
Report an issue: GitHub.