tracy bar is not shown in my web project

thcom
Backer | 94
+
0
-

hi i use latest nette version

in bootstrap.php i have

	$configurator->setDebugMode(TRUE);

when i use dump

	dump($this->template->pruvodce);

it shows only

https://imgur.com/NFqJKFk
and I am not able to click on the triangle to view details of variables

i get dump but i am unable to click on

PHP Version 8.1.4 on nginx webserver

composer dump here :

latte/latte           v2.11.0 ☕ Latte: the intuitive and fast template en...
nette/application     v3.1.5  🏆 Nette Application: a full-stack componen...
nette/bootstrap       v3.1.2  🅱  Nette Bootstrap: the simple way to conf...
nette/caching         v3.1.2  ⏱ Nette Caching: library with easy-to-use A...
nette/component-model v3.0.2  ⚛ Nette Component Model
nette/database        v3.1.5  💾 Nette Database: layer with a familiar PD...
nette/di              v3.0.13 💎 Nette Dependency Injection Container: Fl...
nette/finder          v2.5.3  🔍 Nette Finder: find files and directories...
nette/forms           v3.1.6  📝 Nette Forms: generating, validating and ...
nette/http            v3.1.5  🌐 Nette Http: abstraction for HTTP request...
nette/mail            v3.1.8  📧 Nette Mail: handy email creation and tra...
nette/neon            v3.3.3  🍸 Nette NEON: encodes and decodes NEON fil...
nette/php-generator   v4.0.1  🐘 Nette PHP Generator: generates neat PHP ...
nette/robot-loader    v3.4.1  🍀 Nette RobotLoader: high performance and ...
nette/routing         v3.0.2  Nette Routing: two-ways URL conversion
nette/schema          v1.2.2  📐 Nette Schema: validating data structures...
nette/security        v3.1.5  🔑 Nette Security: provides authentication,...
nette/tester          v2.4.2  Nette Tester: enjoyable unit testing in PHP w...
nette/utils           v3.2.7  🛠  Nette Utils: lightweight utilities for ...
tracy/tracy           v2.9.1  😎  Tracy: the addictive tool to ease debug...

thank you

Ozzrel
Generous Backer | 54
+
0
-

Looks good.

Try

bdump($this->template->pruvodce);
thcom
Backer | 94
+
0
-

sorry, it does not help :/

petr.pavel
Member | 535
+
0
-

There might be a Javascript error on your page that prevents remaining scripts from running. Check out the browser console.

thcom
Backer | 94
+
0
-

petr.pavel wrote:

There might be a Javascript error on your page that prevents remaining scripts from running. Check out the browser console.

i try to create new project with composer create-project nette/web-project test

only enable tracy and try to dump one variable,

dump is showm without possinbility to click on detail

tracy bar is not visible i tried edge, chrome, chrome anonymous, opera

emololftw
Member | 82
+
0
-

Be careful about ordering lines in Bootstrap.php first of all you need setDebugMode and after that enable Tracy bar

$configurator->setDebugMode((bool) \getenv('DOCKER_DEV'));
$configurator->enableTracy($appDir . '/log');
thcom
Backer | 94
+
0
-

emololftw wrote:

Be careful about ordering lines in Bootstrap.php first of all you need setDebugMode and after that enable Tracy bar

I think it is OK

<?php

declare(strict_types=1);

namespace App;

use Nette\Bootstrap\Configurator;


class Bootstrap
{
	public static function boot(): Configurator
	{
		$configurator = new Configurator;
		$appDir = dirname(__DIR__);

//		$configurator->setDebugMode('1X5.X0.2X.2X'); // enable for your remote IP
		$configurator->setDebugMode(TRUE); // enable for your remote IP
		$configurator->enableTracy($appDir . '/log');

		$configurator->setTimeZone('Europe/Prague');
		$configurator->setTempDirectory($appDir . '/temp');

		$configurator->createRobotLoader()
			->addDirectory(__DIR__)
			->register();

		$configurator->addConfig($appDir . '/config/common.neon');
		$configurator->addConfig($appDir . '/config/services.neon');
		$configurator->addConfig($appDir . '/config/local.neon');

		return $configurator;
	}
}

petr.pavel
Member | 535
+
0
-

Did you look into your browser's console? Is there any JavaScript error?

thcom
Backer | 94
+
0
-

petr.pavel wrote:

Did you look into your browser's console? Is there any JavaScript error?

yes i attach error screen and error message

I used plain skeleton
composer create-project nette/web-project nettew

and add only

  • db login to local.neon
  • enmble tracy with
		$configurator->setDebugMode(TRUE);
		$configurator->enableTracy($appDir . '/log');

  • render default method
	public function renderDefault()	{
		dump($this);
	}

})();Nette\InvalidStateException: Cannot send header after HTTP headers have been sent (output started at /var/www/html/nettew/vendor/tracy/tracy/src/Tracy/Debugger/DeferredContent.php:132). in /var/www/html/nettew/vendor/nette/http/src/Http/Response.php:313

screen

petr.pavel
Member | 535
+
0
-

This post is going to be about finding out what's in your /var/www/html/nettew/vendor/tracy/tracy/src/Tracy/Debugger/DeferredContent.php at line 132.

nette/web-project composer.json requires tracy/tracy at version “^2.8” with minimum stability requirement “stable”. So it should install version 2.9.1.
https://github.com/…omposer.json

Is your DeferredContent.php the same as this one?
https://github.com/…dContent.php

Current dev version looks different but it shouldn't be what you have
https://github.com/…dContent.php

Last edited by petr.pavel (2022-04-11 18:53)

dkorpar
Member | 135
+
0
-

There were some bug in tracy 2.9.0, check if you have that version and update to 2.9.1 and problem should dissapear

thcom
Backer | 94
+
0
-

dkorpar wrote:

There were some bug in tracy 2.9.0, check if you have that version and update to 2.9.1 and problem should dissapear

I have 2.9.1.

and tracy is hidden
same error :/

helvete
Member | 16
+
0
-

I also encountered the same problem on a fresh install of nette/web-project.

Like http://up.bahno.net/?…

Inspect closely the browser console “console” tab. For me there was a hint in a warning about invalid src attribute.

You can debug how the link is being generated in here: https://github.com/…loader.phtml#L14

In my case, the problem was caused by double slash at the beginning of the src URI. So I fixed it within webserver (nginx) config by removing leading slashes like this:

@@ -21,8 +21,8 @@ server {
         fastcgi_pass php-fpm:9000;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $document_root/index.php;
-        fastcgi_param SCRIPT_NAME /$fastcgi_script_name;
-        fastcgi_param REQUEST_URI /$uri?$args;
+        fastcgi_param SCRIPT_NAME $fastcgi_script_name;
+        fastcgi_param REQUEST_URI $uri?$args;
         fastcgi_param HTTPS off;
     }

Last edited by helvete (2022-06-03 10:26)