[BUG] "Request contains text fields that are too large" Error in Firebase Studio (Gemini-2.5-pro-preview-06-05)

Hey Firebase Studio Community,

I’m reaching out hoping for some assistance with a persistent error I’ve been encountering while coding in Firebase Studio. I’m currently working on a medium to large-sized application with a lot of complexity (messaging, marketplace, subscriptions, etc.), and this issue has unfortunately brought my progress to a halt.

The specific error message I’m seeing is:

“Sorry, I hit a snag. Please try again shortly or modify your prompt.”

With the console output showing:

[GoogleGenerativeAI Error]: Error fetching from https://monospace-pa.googleapis.com/v1/models/gemini-2.5-pro-preview-03-25:streamGenerateContent?alt=sse: [400 Bad Request] Request contains text fields that are too large.

I’ve already tried several common troubleshooting steps, including:

  • Resetting my context
  • Checking the token count
  • Implementing .studioignore

Unfortunately, none of these have resolved the issue, and the error consistently points to “Request contains text fields that are too large.” This seems to be a more specific problem than general token limits.

I’m currently at a bit of a loss for what else to try on my end and am hoping for a fix.

Has anyone else encountered this specific “Request contains text fields that are too large” error with the gemini-2.5-pro-preview-06-05 model in Firebase Studio? Any insights or potential workarounds would be greatly appreciated!

Thanks in advance for your help.

I found the solution… it was a simple “/clear” in the prototyper and everything is fixed.

1 Like

Thank you for sharing the knowledge; I’ve tried the simple fix, but the issue remains. Welcome other suggestions.