Skip to content

[FrankenPHP+DebugBundle+WebProfilerBundle] Using dd in worker mode results in blank page #61340

@ruudk

Description

@ruudk

Symfony version(s) affected

7.3.2

Description

I'm using Symfony Framework with DebugBundle and WebProfilerBundle enabled and notice something odd.

When I use dd('test'); inside a controller, using PHP FPM, I would see an empty page with the test visible.

But when I switch to FrankenPHP, it no longer works. I get an empty page instead.

When I use dump('test'); I see the dump visible in the Symfony Toolbar.

When I comment out the follow code, dd works as expected:

// This code is here to lazy load the dump stack. This default
// configuration is overridden in CLI mode on 'console.command' event.
// The dump data collector is used by default, so dump output is sent to
// the WDT. In a CLI context, if dump is used too soon, the data collector
// will buffer it, and release it at the end of the script.
VarDumper::setHandler(function ($var, ?string $label = null) use ($container) {
$dumper = $container->get('data_collector.dump');
$cloner = $container->get('var_dumper.cloner');
$handler = function ($var, ?string $label = null) use ($dumper, $cloner) {
$var = $cloner->cloneVar($var);
if (null !== $label) {
$var = $var->withContext(['label' => $label]);
}
$dumper->dump($var);
};
VarDumper::setHandler($handler);
$handler($var, $label);
});

When I disable worker mode, it just works as expected.

How to reproduce

Possible Solution

Could it be related to the fact that the above code works on boot, and maybe together with worker mode this is only called once?

Additional Context

https://frankenphp.dev/docs/worker/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy