Jump to content

Recommended Posts

Posted

Hey @adrian I get the following error when using Tracy with RockFrontend's live reload feature:

Failed to init module: TracyDebugger - Tracy\DeferredContent::sendAssets() called after some output has been sent. Output started at /var/www/html/site/modules/RockFrontend/LiveReload.php:147.

This is the line in question: https://github.com/baumrock/RockFrontend/blob/5f6c822f2f561f7b0d90d46e05eb66d2964d7dbd/LiveReload.php#L147

This is how I'm loading the livereload class: https://github.com/baumrock/RockFrontend/blob/5f6c822f2f561f7b0d90d46e05eb66d2964d7dbd/RockFrontend.module.php#L122-L131

It needs to be loaded before session start. I guess Tracy does not like that ? Any ideas how to fix this? Can I somehow tell Tracy not to load for that requests?

Posted

Hi @bernhard - I am not certain, but I am curious if it helps if SessionHandlerDB is running. Not saying that this is the fix, but it might help me to debug and figure out a solution.

 

Posted
56 minutes ago, adrian said:

I am not certain, but I am curious if it helps if SessionHandlerDB is running.

Thx, it has already been running all the time ? Just tried without it and same issue.

What about adding a $config->noTracy = true config setting that makes sure that tracy is not loaded if the flag is true? I could maybe set that on runtime and it could also be nice to have on production servers maybe?

Posted

Sorry, I am confused why not loading Tracy makes sense in this case, but if that's what you want, there is already a setting for that - first option in the config settings.

  • Thanks 1
  • 2 weeks later...
Posted

Hey Adrian I'm working on another SSE feature and got an error from Tracy invoking the class destructor:

Quote

Warning: Attempt to read property "post" on null in /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module.php on line 2985
Warning: Attempt to read property "tracyPwVersion" on null in /var/www/html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/TracyDebugger.module.php on line 2985

Adding this on top of the method fixes it for me:

if (!$this->wire('input')) return;

Not sure if that could have any side-effects? If not, could you please add that check in __destruct ?

Posted

Hey @adrian I'm using SSE in another module as well (it's so great ? ). There I also hook before Session::init and then disable tracy:


  public function __construct()
  {
    if ($this->wire->config->ajax) return;
    if (!array_key_exists(self::getParam, $_GET)) return;
    $this->addHookBefore("Session::init", function (HookEvent $event) {
      $event->wire->config->tracy = ['enabled' => false];
      $event->object->sessionAllow = false;
      $this->liveLog();
    });
  }

It's the same principle as with RockFrontend, but it's another self::getParam here as it's another module!

So instead of checking against RockFrontend::getParam - which would obviously not work with this other module - could we disable tracy by default if $config->sessionAllow === FALSE ?

  • 2 weeks later...
Posted
29 minutes ago, adrian said:

Maybe I need a minimal test case to see the exact problem.

I'll try to provide one when I find the time!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...