firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

AI: Failed to parse stream (AI/parse-failed)

Open tejasvi opened this issue 1 month ago • 1 comments

Operating System

macOS

Environment (if applicable)

Chrome

Firebase SDK Version

12

Firebase SDK Product(s)

AI

Project Tooling

Expo with Firebase web js.

Detailed Problem Description

I am giving the model a prompt which is expected to generate a very long response. I have tried non-streaming and streaming mode and the failure occurs exactly after 3 minutes. Firebase transactions have 3 minute timeout but I am not using them. I have set the timeout to 20 minutes for the model.

In non-streaming mode the request failed with 502 error and in streaming mode I stop getting new Eventstream messages and a FirebaseError: AI: Failed to parse stream (AI/parse-failed).

Steps and code to reproduce issue

Prompt requesting long response.

Gemini 2.5 pro, thinking budget 32728, safety: block none, timeout: 1200 * 1e3

tejasvi avatar Nov 02 '25 12:11 tejasvi

Hi @tejasvi, thanks for reporting this issue. This is caused by a default timeout of three minutes that we've set. This issue will be fixed after #8890 which should be going in soon.

dlarocque avatar Nov 04 '25 20:11 dlarocque