extrakun's avatar

dd() doesn't have line-breaks when previewing in Chrome 61

Does anyone else has the same problem? When I do a dd() using Chrome 61, the preview tab in the Network tab shows the dump in one line.

0 likes
6 replies
tisuchi's avatar

It seems working fine in my side.

2 likes
ModestasV's avatar

Sometimes I have the same problem. Diagnosed it and found out that there is one of the following:

  1. You have way too much data and renderer crashes.
  2. You have dump() and dd() in the same tab
  3. There is data in the dump() or dd() that breaks the dump script pretifier
extrakun's avatar

I downloaded to a prior version of Chrome, and it is working again.

Salvis's avatar

I have the same problem. It's impossible to debug. Funny, Firefox has removed "preview" tab completely.

masoudmanson's avatar

You can update Laravel's dd() function in order to force your browser to show dd result in a readable way :D

if (! function_exists('dd')) {
    /**
     * Dump the passed variables and end the script.
     *
     * @param  mixed
     * @return void
     */
    function dd(...$args)
    {
        http_response_code(500);
        foreach ($args as $x) {
            (new Dumper)->dump($x);
        }

        die(1);
    }
}

I just add http_response_code(500)

[Thanks to Chris] (https://laracasts.com/discuss/channels/laravel/when-debugging-in-network-tab-dd-output-is-the-previewable/replies/377784)

Please or to participate in this conversation.