Tesla2k's avatar

Dump omitts rest of page

Hello, recently when I use dump. The rest of the page is not shown. There is now HTML code generated, just the code for the dump. Usually I see the dump and afterwards the rest of the normal page.

I don't know if it happend because of an update or something else.

Any Ideas?

Thank You

Here is my composer.json

0 likes
9 replies
Glukinho's avatar

How exactly do you call dump?

dump($something); // outputs dump and goes on processing

dd($something); // outputs dump and terminates (dd means dump & die)
Tesla2k's avatar

I do dump($something);

The execution is not stopped. If i do

dump("a");
dump("b");

I see a und b

Glukinho's avatar

@Tesla2k dump() outputs a lot of HTML + JS code to browser, it can interfere with a code already presented on a page, so it's not guaranteed that layout will be the same with dump included. Some elements may be not shown or shown incorrectly. I usually include dump to quickly overview a variable and then remove it, not having it in my code all the time, by this reason exactly.

Tesla2k's avatar

@Glukinho Yes I know, but I checked it there is no sign of the original page in the html output. Somehow when i call at least one dump command no other html code is generated...

Glukinho's avatar

@Tesla2k It can happen too if you call dump before returning a view response. Dump content becomes a response itself and your view is not generated (you can't send two responses for one request).

Is it a problem? Your variable is dumped after all, nobody promised your html layout will remain intact when dump is used. If you want to debug without touching your html, use other options (logging, xdebug, laravel-debugbar...).

Tesla2k's avatar

@Glukinho Yes it make to work at least harder and also exception, which are normally shown as a error page are not displayed... I am sure its not a normale behavoir, but i do not know what causes it.

Glukinho's avatar

@Tesla2k Exceptions should be displayed as error page unless you have APP_DEBUG=false in .env file or played with render / report methods in exception classes or bootstrap/app.php file.

What exactly you see when an exceptions is thrown?

Tesla2k's avatar

@Glukinho When I have no dump I see the normal exception message in the Browser, when I have a dump I see nothing. (Execept the dump)

Tesla2k's avatar
Tesla2k
OP
Best Answer
Level 1

Ok i found a solution

composer update symfony/*

fixed it.

This is what got updated:

  - Upgrading symfony/console (v7.3.0 => v7.3.1)
  - Upgrading symfony/error-handler (v7.3.0 => v7.3.1)
  - Upgrading symfony/http-foundation (v7.3.0 => v7.3.1)
  - Upgrading symfony/http-kernel (v7.3.0 => v7.3.1)
  - Upgrading symfony/mailer (v7.3.0 => v7.3.1)
  - Upgrading symfony/options-resolver (v7.2.0 => v7.3.0)
  - Upgrading symfony/polyfill-iconv (v1.31.0 => v1.32.0)
  - Upgrading symfony/psr-http-message-bridge (v7.2.0 => v7.3.0)
  - Upgrading symfony/stopwatch (v7.1.6 => v7.3.0)
  - Upgrading symfony/translation (v7.3.0 => v7.3.1)
  - Upgrading symfony/uid (v7.3.0 => v7.3.1)
  - Upgrading symfony/var-dumper (v7.3.0 => v7.3.1)
  - Upgrading symfony/yaml (v7.1.6 => v7.3.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 13 updates, 0 removals
  - Upgrading symfony/polyfill-iconv (v1.31.0 => v1.32.0): Extracting archive
  - Upgrading symfony/var-dumper (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/uid (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/mailer (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/http-foundation (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/error-handler (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/http-kernel (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/console (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/translation (v7.3.0 => v7.3.1): Extracting archive
  - Upgrading symfony/yaml (v7.1.6 => v7.3.1): Extracting archive
  - Upgrading symfony/options-resolver (v7.2.0 => v7.3.0): Extracting archive
  - Upgrading symfony/psr-http-message-bridge (v7.2.0 => v7.3.0): Extracting archive
  - Upgrading symfony/stopwatch (v7.1.6 => v7.3.0): Extracting archive
1 like

Please or to participate in this conversation.