framework: New Version of Chrome cannot render dd function in network preview window
- Laravel Version: 5.4.* and 5.5.*
- PHP Version: 7.0.13
- Database Driver & Version: Mysql 5.6
Description:
When updated to chrome version 62.0.3202.66, dd function cannot be rendered by chrome network preview window.
And I have found the changelog of chrome. Commit f674b40baf2d44d1b27f33b3ed39e60b2b9169da
says it will not render as HTML agressively if requested via XHR.
Steps To Reproduce:
- Update to chrome version 62.0.3202.66
- Execute a dd function
- Check the chrome network preview window
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 33 (7 by maintainers)
This function works pretty well for me. Only handles the HTML Dumper, not the CLI dumper, so it wont work in artisan commands, but if you’re using those you can just use the normal
dd()
function.Yeah, I’ve updated to 68 and it works again, “Sweet sweet preview scroll, never leave me again”
If you want to change status to 500 for your ajax requests you just need to update
project/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
class on line111
wheredump()
method exists. Just add linehttp_response_code(500);
at the beginning of function. It works for Laravel 5.6 version.Using
die($item)
instead ofdd($item)
on a model renders the json in the network tab same as a json response. The object have to implement__toString()
though.@tonghia I tested after adding
<html></html>
tag, it also doesn’t work. @alinasiri1367 there are some approaches to solve it in this issue