symfony / symfony

The Symfony PHP framework
https://symfony.com
MIT License
29.71k stars 9.44k forks source link

An exception has been thrown during the rendering of a template ("array_reduce(): Argument #1 ($array) must be of type array, Symfony\Component\VarDumper\Cloner\Data given"). #58586

Closed soyUnaGata closed 1 hour ago

soyUnaGata commented 2 hours ago

Symfony version(s) affected

6.4 and 7.1

Description

Hello! I just faced an issue when updating from Symfony 5 to 6.4. I also tried updating to version 7.1, but it didn't fix the problem.

image image

I encounter this issue in the profiler when trying to view the Logs section. Versions of the tools: "symfony/web-profiler-bundle": "6.4.11" "symfony/debug-bundle": "6.4.8"

How to reproduce

Go to profiler and try to open Logs sections. Other sections works good.

Possible Solution

When I'm changing this in template {% set compilerLogTotal = collector.compilerLogs|reduce((total, logs) => total + logs|length, 0) %} to this {% set compilerLogTotal = 0 %} {% set compilerLogCount = collector.compilerLogs|length %} It's become working, but I'm not sure that it's correct.

Additional Context

If you need any additional information, please let me know. It's my first update ever, so thank you in advance.

xabbuh commented 2 hours ago

Can you create a small example application that allows to reproduce your issue?

soyUnaGata commented 2 hours ago

Can you create a small example application that allows to reproduce your issue?

Hello! I'm so sorry, but in empty (only one controller and twig template) I also tried to add some date, it's working. So maybe it's because of other packages 😔 Sorry, for wasting your time

alexandre-daubois commented 1 hour ago

Can you close the issue as solved if it's now ok for you please? 🙂