# JSException Maximum Call Stack Size Exceeded

## Environment

<table>
    <tbody>
        <tr>
            <td>Product</td>
            <td>UI for Blazor</td>
        </tr>
    </tbody>
</table>

## Description

This knowledge base article deals with the `Maximum call stack size exceeded` error.

## Error Message

`Microsoft.JSInterop.JSException: Maximum call stack size exceeded`

`RangeError: Maximum call stack size exceeded`

## Cause

The possible causes for the `Maximum call stack size exceeded` error are:

* Using an old version of Telerik UI for Blazor (4.5.0 and older) in .NET 8 or 9.
* Updating an existing app to .NET 8 or 9 without updating Telerik UI for Blazor.
* Using different versions of Telerik UI for Blazor in different projects in your solution. Some of the versions are earlier than 4.6.0.
* Building a .NET 6 Telerik Blazor app with the .NET 8 SDK on a Mac.
* Using a cached old version of `telerik-blazor.js` with up-to-date Telerik UI for Blazor version. In this case, the app may be runnable in one browser and not in another.

## Solution

To resolve the error:

* Use a Telerik UI for Blazor version, which is [compatible with .NET 8](https://www.telerik.com/blazor-ui/documentation/system-requirements#supported-net-versions).
* Clear the browser cache and [add a cache buster for the Telerik CSS and JavaScript files](https://www.telerik.com/blazor-ui/documentation/knowledge-base/common-browser-cache-buster).

Clearing the browser cache will reload the `telerik-blazor.js` file and the error should go away.

If the Telerik UI for Blazor version is up-to-date and the error persists, then clean the solution:

1. Close Visual Studio.
2. Delete all `bin` and `obj` folders in all projects in the solution.
3. Clear the browser cache.
4. Reopen Visual Studio and rebuild the app.

## Notes

If you receive a `TelerikBlazor was undefined` JavaScript error after you clear the browser cache, then refer to the [documentation about `TelerikBlazor was undefined`](https://www.telerik.com/blazor-ui/documentation/troubleshooting/js-errors#telerikblazor-was-undefined).

## See Also

* [Troubleshoot JavaScript Errors](https://www.telerik.com/blazor-ui/documentation/troubleshooting/js-errors)
