After upgrading from 1.3 to 2.0, I'm receiving this error.
This is when using {{ vardumper(content) }} in a node.html.twig file.
Twig\Error\SyntaxError: An exception has been thrown during the compilation of a template ("The last parameter of "Drupal\twig_vardumper\TwigExtension::drupalDump" for function "vardumper" must be an array with default value, eg. "array $arg = []".") in "themes/custom/themename/templates/content/node--foobar.html.twig". in Twig\Environment->compileSource() (line 798 of /app/vendor/twig/twig/src/Environment.php).
What's the correct new syntax?
Thanks!
Comments
Comment #2
alphex commentededit, removing private info
Comment #3
kevinedmister commentedAlso having this issue. Doesn't matter how you use, empty or with variable, it returns the same error. This is also true for {{ dump() }}. Started after the most recent update.
Comment #4
kevinedmister commentedChanging line 64 of /twig_vardumper/src/TwigExtension.php to:
...$varstoarray $vars = []seemed to work.Comment #7
keopxThanks for issue :)
Comment #8
keopx