Problem with stream #8813
Replies: 2 comments 2 replies
-
|
For anyone who comes across this, it may be related to: Maximum execution time of 30 seconds exceeded Change or add this line in php.ini: |
Beta Was this translation helpful? Give feedback.
-
|
Anyone else run into this? I have an old project (started on Laravel 8 + Livewire 2, now upgraded to Laravel 12 + Livewire 3) where wire:stream causes a Unexpected end of JSON input error at the end of the stream. In a fresh Laravel 12 + Livewire 3 project, the same code works fine. In the working project, the response ends with a {"components":[...]} I removed all middlewareand dev tools, but nothing helps. Anyone know what might cause Livewire to skip the final response? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Livewire version
v3.5.8
Laravel version
v10.48.20
Which PHP version are you using?
PHP 8.3
Steps To Reproduce
Bug Report: JSON Parsing Error in HasKheops Trait During Streaming
Description:
When using the
HasKheopstrait, there is an issue where aSyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSONis thrown during a streaming request.This occurs when the following conditions are met:
askKheopsmethod is executed to handle LLM (Large Language Model) responses.Error Stack:
VM6546:1 Uncaught (in promise) SyntaxError: Unexpected token '<', ") at sendRequest (livewire.js?id=cc800bf4:4321:52) at async RequestPool.send
Steps to Reproduce:
askKheopsmethod.HandlesStreaming.Expected Behavior:
The stream should complete without attempting to parse non-JSON data, or the error should be handled gracefully if the response is not valid JSON.
Code Sample:
Beta Was this translation helpful? Give feedback.
All reactions