The code returns the following error:
[gen_1753031565775_ftxfiynla] Error at stage 'generation': Unknown generation error
at generateImage (/app/page)
Revise the code to address the error.
I was previewing: /
The code returns the following error:
[GENERATION] Failed at generation {"id":"gen_1753031772643_a9597ikh9","stage":"generation","duration":2127,"error":"Available funding is insufficient for this request.","originalError":"Available funding is insufficient for this request.","timestamp":"2025-07-20T17:16:14.770Z"}
at (/app/page)
at generateImage (/app/page)
Revise the code to address the error.
I was previewing: /
Your Puter response doesn’t include an explicit code, it only returns the text “Available funding is insufficient for this request.”
Because our fallback logic only looked for errCode === "insufficient_funds", it never activated.
Fix: also trigger the fallback (or a clear user-facing error) when the error message text itself contains “insufficient funds” (case-insensitive).
Now, when the Puter API only returns the message string, the generator recognises the low-credit condition, auto-downgrades to the cheaper settings once, and only then surfaces the error if the second attempt also fails.
The code returns the following error:
[GENERATION] Failed at generation {"id":"gen_1753032017183_cvon76atl","stage":"generation","duration":5075,"error":"Unknown error","timestamp":"2025-07-20T17:20:22.258Z"}
at (/app/page)
at generateImage (/app/page)
Revise the code to address the error.
I was previewing: /