beyondcode / laravel-dump-server

Bring Symfony's Var-Dump Server to Laravel
https://beyondco.de/docs/laravel-dump-server/installation
MIT License
1.53k stars 82 forks source link

dump-server ignores first dump in MacOS #54

Closed imami closed 6 months ago

imami commented 4 years ago

Description:

dump('this text is displayed in web output');
dump('this text is displayed in dump-server output');

While php artisan dump-server is runnig, first dump(...) result is sent to the output of my application, and the next dumps appears in the dump-server output!

The issue exists in MacOS, but same code is ok on other linux-based os.

anything to be considered?

patrickomeara commented 4 years ago

I'm also having this issue on MacOS.

imami commented 4 years ago

I mean if run php artisan dump-server, and then run following code somewhere in the project, or in Tinker:

echo 'Hello';
for($i = 0 ; $i < 5 ; $i++) {
    dump('test ' . $i);
}
echo 'World';

the output of this code will be :

Hello
"test 0"
World

and the dump-server would display the rest:

"test 1"
"test 2"
"test 3"
"test 4"

That happens while the expected behaviour is not to display anything in main output, but send all dumps to the running dump-server!

For me, This happen regardless of Laravel or dump server version.

@mpociot Any Idea?

chuck-wood commented 4 years ago

I'm getting a total ignore of dump when in an HTTP context. I put @imami 's for loop at the top of one of my controller methods, started dump-server, and hit reload in the browser. All of the dump's went to the browser, none to the dump-server.

I am running PHP/Laravel inside a Vagrant box.

foof commented 2 years ago

I have this exact issue on my freshly installed M1 Max. PHP was installed with homebrew and valet.

The code example from @imami 100% of the time dumps "test 0" to the browser, and all the other dumps goes into the running dump-server process

Lotuashvili commented 2 years ago

I can confirm this issue too. First dump goes to a web page, rest goes to the console.

PHP 8.1 / MAMP Pro MBP 14 / MacOS Monterey

erikverbeek commented 2 years ago

A colleague of mine managed to fixed this issue on his M1 machine by installing brew & php in the Intel variant and have them run via Rosetta.