maximebf / php-debugbar

Debug bar for PHP
phpdebugbar.com
MIT License
4.18k stars 399 forks source link

twig collector errors #430

Open Stijn98s opened 4 years ago

Stijn98s commented 4 years ago

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

parallels999 commented 9 months ago

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