anuraghazra / anuraghazra/github-readme-stats

top-langs fails with theme or custom colors

Open
#4,779 16 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
79.8k
Forks
37.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When using the **`top-langs`** card via `readme-tools/github-readme-stats-action@v1` the action crashes with:

`TypeError: Cannot use 'in' operator to search for 'border_color' in undefined`

The error occurs consistently when:

- a valid theme is set (e.g. `dracula`, `github_dark`)
- custom colors are used without a theme

Interestingly, the card **does not fail** when an **invalid theme name** is provided ... I accidentally tried `github_dar` and it worked.

---

**Tested option configurations:**
Fails – valid theme
...&layout=compact&langs_count=9&theme=dracula

Fails – custom colors without theme
...&layout=compact&langs_count=9&title_color=628fdb&text_color=36b2a5&bg_color=1a1b27

Fails – custom colors with valid theme
...&layout=compact&langs_count=9&theme=github_dark&title_color=628fdb&text_color=36b2a5&bg_color=1a1b27

Fails – minimal config
...&layout=compact&langs_count=9

**Works** – invalid theme name
...&layout=compact&langs_count=9&theme=github_dar

---

I'm pretty sure that's a bug because I've read the readme and it says "You can customize the appearance and behavior of the top languages card using the [common options](https://github.com/anuraghazra/github-readme-stats?tab=readme-ov-file#common-options) and exclusive options listed in the table below." so it should work I guess

### Expected behavior

Theme or at least custom colors should be applied and the svg should build without errors

### Screenshots / Live demo link

You can check my [runs](https://github.com/binnichtaktiv/binnichtaktiv/actions/runs/21707180561) and [commits](https://github.com/binnichtaktiv/binnichtaktiv/commits/main/.github/workflows/main.yml)

### Additional context

If I forgot some info pls lmk I'll send asap

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the listed top-langs configurations, including a valid theme, custom colors, and minimal options, using the linked workflow run as reference. Trace the top-langs card generation from those inputs and verify that valid themes, custom colors, and minimal configuration produce an SVG without the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.