php-debugbar icon indicating copy to clipboard operation
php-debugbar copied to clipboard

twig collector errors

Open Stijn98s opened this issue 5 years ago • 1 comments

When i use the twig collection code example in the repo i get javascript errors in my console

Uncaught TypeError: Cannot read property 'ajax' of null
    at itemRenderer (widget.js:22)
    at child.<anonymous> (widgets.js:155)
    at child.set (debugbar.js:155)
    at child.<anonymous> (widget.js:63)
    at child.set (debugbar.js:155)
    at child.<anonymous> (debugbar.js:287)
    at child.set (debugbar.js:155)
    at Array.<anonymous> (debugbar.js:978)
    at Function.each (jquery.min.js:2)
    at child.dataChangeHandler (debugbar.js:972) 

Here is my code

                $profile = new \Twig\Profiler\Profile();
                $container[ViewManager::class]->getEnvironment()->addExtension(new \DebugBar\Bridge\Twig\TimeableTwigExtensionProfiler($profile));
                $container[DebugManager::class]->getBar()->addCollector(new \DebugBar\Bridge\TwigProfileCollector($profile));

when i add the time collector to the TimeableTwigExtensionProfiler i get an Failed stopping measure 'home.twig' because it hasn't been started error.

I hope someone can help

Stijn98s avatar Nov 19 '19 21:11 Stijn98s

Fixed on https://github.com/maximebf/php-debugbar/pull/377

parallels999 avatar Sep 27 '23 21:09 parallels999