# Consistent file read issue. Token limit?

**URL:** <https://community.firebasestudio.dev/t/consistent-file-read-issue-token-limit/12067>\
**Category:** General\
**Created:** [May 12, 2025, 12:26pm UTC](https://community.firebasestudio.dev/t/consistent-file-read-issue-token-limit/12067 "2025-05-12T12:26:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cruzan](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/cruzan/32/5816_2.png) [@cruzan](https://community.firebasestudio.dev/u/cruzan)\
**Post date:** [May 12, 2025, 12:26pm UTC](https://community.firebasestudio.dev/t/consistent-file-read-issue-token-limit/12067/1 "2025-05-12T12:26:08Z")

</div>

I am consistently encountering  
“An internal error has occurred. Please retry or report in [Troubleshooting guide &nbsp;|&nbsp; Gemini API &nbsp;|&nbsp; Google AI for Developers](https://developers.generativeai.google/guide/troubleshooting)”  
when gemini-2.5-pro-preview-05-06 in Firebase Studio is trying to read any file over about 5000 tokens.

The interesting thing is if i go over to [aistudio.google.com](http://aistudio.google.com) it has no problem reading and updating the same files. Perhaps there is some hidden token limit in Firebase that is preventing the models from working with larger inputs?

---

<div class="post-metadata">

**Author:** ![carey\_blunt](https://sea2.discourse-cdn.com/flex002/user_avatar/community.firebasestudio.dev/carey_blunt/32/6847_2.png) [@carey\_blunt](https://community.firebasestudio.dev/u/carey_blunt)\
**Post date:** [June 3, 2025, 6:46am UTC](https://community.firebasestudio.dev/t/consistent-file-read-issue-token-limit/12067/2 "2025-06-03T06:46:21Z")

</div>

I have the same issue with reading and updating files of even a modest size. Anything over a few hundred lines. Its making it impossible to continue with my project because your codebase will not stay small forever. I will try the aistudio work around but it doesn’t sound ideal.
