litellm - 💡(How to fix) Fix [Bug]: UI Crash: RangeError: Maximum call stack size exceeded in unfurlWildcardModelsInList [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Uncaught RangeError: Maximum call stack size exceeded at f4d1949f60a5a018.js:1:30683 at Array.forEach (<anonymous>) at f4d1949f60a5a018.js:1:30588 at 37821c5764fddf43.js:231:22419 at ih (726579f2940c2a2f.js:1:102202) at uf (726579f2940c2a2f.js:1:126052) at uc (726579f2940c2a2f.js:1:125714) at uf (726579f2940c2a2f.js:1:126097) at uc (726579f2940c2a2f.js:1:125714) at uf (726579f2940c2a2f.js:1:126097)

Fix Action

Fixed

Code Example

e.forEach(e => {
    if (e.endsWith("/*")) {
        let s = e.replace("/*", "")
          , n = t.filter(e => e.startsWith(s + "/"));
        i.push(...n), // <--- CRASHES HERE if 'n' is too large
        r.push(e)
    }
})

---

// Safe alternative
i = i.concat(n);

---

Uncaught RangeError: Maximum call stack size exceeded
    at f4d1949f60a5a018.js:1:30683
    at Array.forEach (<anonymous>)
    at f4d1949f60a5a018.js:1:30588
    at 37821c5764fddf43.js:231:22419
    at ih (726579f2940c2a2f.js:1:102202)
    at uf (726579f2940c2a2f.js:1:126052)
    at uc (726579f2940c2a2f.js:1:125714)
    at uf (726579f2940c2a2f.js:1:126097)
    at uc (726579f2940c2a2f.js:1:125714)
    at uf (726579f2940c2a2f.js:1:126097)
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Bug: When viewing the Teams page, the UI crashes with a Maximum call stack size exceeded error.

Cause: In the unfurlWildcardModelsInList function, the code uses i.push(...n) to merge arrays. If a wildcard model matches a very large number of models in allModels (e.g., thousands), the spread operator (...) exceeds the JavaScript engine's maximum argument limit.

e.forEach(e => {
    if (e.endsWith("/*")) {
        let s = e.replace("/*", "")
          , n = t.filter(e => e.startsWith(s + "/"));
        i.push(...n), // <--- CRASHES HERE if 'n' is too large
        r.push(e)
    }
})

Suggested Fix

// Safe alternative
i = i.concat(n);

Steps to Reproduce

  1. Add Multiple teams on litellm.
  2. Refresh the page

Relevant log output

Uncaught RangeError: Maximum call stack size exceeded
    at f4d1949f60a5a018.js:1:30683
    at Array.forEach (<anonymous>)
    at f4d1949f60a5a018.js:1:30588
    at 37821c5764fddf43.js:231:22419
    at ih (726579f2940c2a2f.js:1:102202)
    at uf (726579f2940c2a2f.js:1:126052)
    at uc (726579f2940c2a2f.js:1:125714)
    at uf (726579f2940c2a2f.js:1:126097)
    at uc (726579f2940c2a2f.js:1:125714)
    at uf (726579f2940c2a2f.js:1:126097)

What part of LiteLLM is this about?

UI Dashboard

What LiteLLM version are you on ?

v1.83.13

Twitter / LinkedIn details

https://in.linkedin.com/in/showmik-bose

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING