davila7/claude-code-templates · error

Failed to load marketplaces

Error message

Failed to load marketplaces

What it means

HTTP 500 from GET /api/marketplaces in the plugin dashboard when loading marketplace data throws inside loadPluginData/marketplace loading. The console line 'Error loading marketplaces:' on the server carries the underlying cause.

Source

Thrown at cli-tool/src/plugin-dashboard.js:568

      next();
    });

    // Serve static files
    this.app.use(express.static(path.join(__dirname, 'plugin-dashboard-web')));

    // API endpoints - reload data on each request
    this.app.get('/api/marketplaces', async (req, res) => {
      try {
        await this.loadPluginData();
        res.json({
          marketplaces: this.marketplaces || [],
          count: (this.marketplaces || []).length,
          timestamp: new Date().toISOString()
        });
      } catch (error) {
        console.error('Error loading marketplaces:', error);
        res.status(500).json({ error: 'Failed to load marketplaces' });
      }
    });

    this.app.get('/api/plugins', async (req, res) => {
      try {
        await this.loadPluginData();
        res.json({
          plugins: this.plugins || [],
          count: (this.plugins || []).length,
          timestamp: new Date().toISOString()
        });
      } catch (error) {
        console.error('Error loading plugins:', error);
        res.status(500).json({ error: 'Failed to load plugins' });
      }
    });

    this.app.get('/api/permissions', async (req, res) => {

View on GitHub (pinned to a0851ed10c)

Solutions

  1. Check server console for 'Error loading marketplaces:' and the real error message
  2. Validate/repair or delete the marketplace config/cache file so it regenerates (back it up first)
  3. Verify read permissions on the plugins config directory
  4. Reinstall or update the plugin-dashboard package if the loader is outdated for the current config format
Defensive patterns

Strategy: try-catch

Validate before calling

null

Try / catch

try { const data = await getMarketplaces(); } catch (e) { showError(e.message); // fall back to empty list render renderMarketplaces([]); }

Prevention

When it happens

Trigger: GET /api/marketplaces when reading/parsing the plugins config (e.g. ~/.claude/plugins or the marketplaces cache) fails — malformed JSON, unreadable directory, or an unexpected entry shape while building this.marketplaces.

Common situations: Corrupted marketplace cache/JSON after an interrupted write; permissions changes on the config directory; a hand-edited or third-party marketplace entry with fields the loader doesn't expect; partial install/upgrade of the package.

Related errors


AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28). Data as JSON: /api/errors/0d4f958dfa04a805. Report an issue: GitHub.