qruto / laravel-wave

Painless Laravel Broadcasting with SSE
MIT License
749 stars 29 forks source link

[Bug]: ob_flush(): Failed to flush buffer. No buffer to flush #35

Closed edalzell closed 1 year ago

edalzell commented 1 year ago

What happened?

Running SSE normally (redis worker running, Echo on front end).

See a ton of these in my log: https://flareapp.io/share/87newjDP

How to reproduce the bug

Run my app.

Sorry don't know the repro issue yet.

Package Version

0.7.1

PHP Version

8.2.8

Laravel Version

10.18.0

Which operating systems does with happen with?

macOS

Notes

No response

edalzell commented 1 year ago

This code silences the error, not sure yet if everything still works:

if (ob_get_contents()) {
    ob_flush();
}
slavarazum commented 1 year ago

Hi @edalzell. Probably you have disabled output buffering on the server.

Is it works normal on a local environment? Have you debugged what echo $this returns at ServerSentEvent::__invoke method?

edalzell commented 1 year ago

Hi @edalzell. Probably you have disabled output buffering on the server.

Is it works normal on a local environment? Have you debugged what echo $this returns at ServerSentEvent::__invoke method?

This error is occurring locally. And I didn't get it before, it's a new thing.

edalzell commented 1 year ago

But I did switch recently to Herd (from Brew/Valet), so maybe it is off? I'll check, thanks!

slavarazum commented 1 year ago

Probably we have found a source, let test it on Herd.

edalzell commented 1 year ago

Confirmed, Herd does NOT have output_buffering = 4096 in its php.ini.

Sorry about the confusion.

slavarazum commented 1 year ago

NP, thank you for your involvement.