{"record":{"id":"616520115eab561b","repo":"davila7/claude-code-templates","slug":"warning-error-loading-plugin-plugindir","errorCode":null,"errorMessage":"Warning: Error loading plugin ${pluginDir}","messagePattern":"Warning: Error loading plugin (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli-tool/src/plugin-dashboard.js","lineNumber":221,"sourceCode":"              const pluginJson = JSON.parse(await fs.readFile(pluginJsonPath, 'utf8'));\n\n              // Count components\n              const components = await this.countPluginComponents(pluginPath);\n\n              plugins.push({\n                name: pluginJson.name,\n                version: pluginJson.version || '1.0.0',\n                description: pluginJson.description || 'No description',\n                marketplace: marketplaceDir,\n                path: pluginPath,\n                components,\n                author: pluginJson.author,\n                homepage: pluginJson.homepage,\n                license: pluginJson.license\n              });\n            }\n          } catch (error) {\n            console.warn(chalk.yellow(`Warning: Error loading plugin ${pluginDir}`), error.message);\n          }\n        }\n      }\n\n      return plugins;\n    } catch (error) {\n      console.warn(chalk.yellow('Warning: Error loading plugins'), error.message);\n      return [];\n    }\n  }\n\n  async loadPluginsFromMarketplace(marketplacePath, marketplaceName) {\n    const plugins = [];\n\n    try {\n      const marketplaceJsonPath = path.join(marketplacePath, '.claude-plugin', 'marketplace.json');\n      const content = await fs.readFile(marketplaceJsonPath, 'utf8');\n      const marketplaceData = JSON.parse(content);","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/davila7/claude-code-templates/blob/a0851ed10c7c60463dac8cfaaca124cf32d5804d/cli-tool/src/plugin-dashboard.js#L203-L239","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: plugin.json missing\n{\"name\": \"foo\"}\n// after: valid manifest at ~/.claude/plugins/foo/plugin.json\n{\n  \"name\": \"foo\",\n  \"version\": \"1.0.0\",\n  \"description\": \"...\",\n  \"author\": \"...\"\n}","handlingStrategy":"validation","validationCode":"const manifest = path.join(pluginDir, 'plugin.json');\nif (!fs.existsSync(manifest)) continue; // skip pluginless folder\nconst json = JSON.parse(fs.readFileSync(manifest, 'utf8'));","typeGuard":"const isPluginManifest = (v) => v != null && typeof v.name === 'string' && typeof v.version === 'string';","tryCatchPattern":"catch (e) { console.warn(`Skipping plugin ${pluginDir}:`, e.message); }","preventionTips":["Validate plugin.json with a schema before installing.","Delete half-installed plugin folders.","Pin to marketplace-installed plugins rather than manual copies."],"tags":["plugin","json-parse","manifest"],"backgroundTag":"plugin-manifest-invalid","analyzedSha":"a0851ed10c7c60463dac8cfaaca124cf32d5804d","analyzedAt":"2026-08-28T14:11:56.058Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}