Twig\Error\RuntimeError {#1309 -lineno: 1 -name: "_common/flashes.html.twig" -rawMessage: "An exception has been thrown during the rendering of a template ("Failed to start the session because headers have already been sent by "/home/v0-dev/public_html/vendor/symfony/webpack-encore-bundle/src/Twig/EntryFilesTwigExtension.php" at line 57.")." -sourcePath: "/home/v0-dev/public_html/templates/_common/flashes.html.twig" -sourceCode: """ {% for message in app.flashes('success') %}\n <div class="alert alert-success" style="text-align: center;">\n {{ message }}\n </div>\n {% endfor %}\n {% for message in app.flashes('danger') %}\n <div class="alert alert-danger" style="text-align: center;">\n {{ message }}\n </div>\n {% endfor %}\n {% for message in app.flashes('debug') %}\n <div class="alert alert-info" style="text-align: center;">\n {{ message }}\n </div>\n {% endfor %}\n """ }
{% for message in app.flashes('success') %}<div class="alert alert-success" style="text-align: center;">{{ message }}</div>{% endfor %}{% for message in app.flashes('danger') %} return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } yield from $this->template->yieldBlock($name, $context); } public function render(array $context = []): string { return $this->template->render($context); } /** * @return void */ if ($isSandboxed) { $loaded->unwrap()->checkSecurity(); } return $loaded->render($variables); } finally { if ($isSandboxed && !$alreadySandboxed) { $sandbox->disableSandbox(); } } yield "<div class=\"page\"> <div class=\"site-width\"> "; // line 25 yield Twig\Extension\CoreExtension::include($this->env, $context, "_common/flashes.html.twig"); yield " <h1>"; // line 26 yield from $this->unwrap()->yieldBlock('h1', $context, $blocks); yield "</h1> { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "site/error/show.html.twig")); $this->parent = $this->loadTemplate("site/site.html.twig", "site/error/show.html.twig", 1); yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks)); $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof); $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof); { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } yield from $this->template->yieldBlock($name, $context); } public function render(array $context = []): string { return $this->template->render($context); } /** * @return void */ * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ public function render($name, array $context = []): string { return $this->load($name)->render($context); } /** * Displays a template. * } if ('dev' === $appEnv) { // Customize your response object to display the exception details $response = new Response(); $response->setContent($this->twig->render('site/error/show.html.twig', [ 'message' => $exception->getMessage(), ])); // HttpExceptionInterface is a special type of exception that // holds status code and header details $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { if ($pop = $request !== $this->requestStack->getMainRequest()) { $this->requestStack->push($request); } try { $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST); } finally { if ($pop) { $this->requestStack->pop(); } } if ($hasRun) { throw $e; } $hasRun = true; $kernel->terminateWithException($e, $request); }; } } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $this->exceptionHandler = null; } try { if (null !== $exceptionHandler) { $exceptionHandler($exception); return; } $handlerException ??= $exception; } catch (\Throwable $handlerException) { if (\PHP_SESSION_ACTIVE === session_status()) { throw new \RuntimeException('Failed to start the session: already started by PHP.'); } if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && headers_sent($file, $line)) { throw new \RuntimeException(sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); } $sessionId = $_COOKIE[session_name()] ?? null; /* * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. } if (!$this->started && $this->saveHandler->isActive()) { $this->loadSession(); } elseif (!$this->started) { $this->start(); } return $this->bags[$name]; } $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->usageIndex, $this->usageReporter)); } public function getBag(string $name): SessionBagInterface { $bag = $this->storage->getBag($name); return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; } /** /** * Gets the flashbag interface. */ public function getFlashBag(): FlashBagInterface { return $this->getBag($this->flashName); } /** * Gets the attributebag interface. * if (null === $types || '' === $types || [] === $types) { return $session->getFlashBag()->all(); } if (\is_string($types)) { return $session->getFlashBag()->get($types); } $result = []; foreach ($types as $type) { $result[$type] = $session->getFlashBag()->get($type); } // Some objects throw exceptions when they have __call, and the method we try // to call is not supported. If ignoreStrictCheck is true, we should return null. try { $ret = $object->$method(...$arguments); } catch (\BadMethodCallException $e) { if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) { return; } throw $e; $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "_common/flashes.html.twig")); // line 1 $context['_parent'] = $context; $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 1, $this->source); })()), "flashes", ["success"], "method", false, false, false, 1)); foreach ($context['_seq'] as $context["_key"] => $context["message"]) { // line 2 yield " <div class=\"alert alert-success\" style=\"text-align: center;\"> "; // line 3 { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } yield from $this->template->yieldBlock($name, $context); } public function render(array $context = []): string { return $this->template->render($context); } /** * @return void */ if ($isSandboxed) { $loaded->unwrap()->checkSecurity(); } return $loaded->render($variables); } finally { if ($isSandboxed && !$alreadySandboxed) { $sandbox->disableSandbox(); } } yield "<div class=\"page\"> <div class=\"site-width\"> "; // line 25 yield Twig\Extension\CoreExtension::include($this->env, $context, "_common/flashes.html.twig"); yield " <h1>"; // line 26 yield from $this->unwrap()->yieldBlock('h1', $context, $blocks); yield "</h1> { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"]; $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "site/error/show.html.twig")); $this->parent = $this->loadTemplate("site/site.html.twig", "site/error/show.html.twig", 1); yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks)); $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof); $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof); { $context += $this->env->getGlobals(); $blocks = array_merge($this->blocks, $blocks); try { yield from $this->doDisplay($context, $blocks); } catch (Error $e) { if (!$e->getSourceContext()) { $e->setSourceContext($this->getSourceContext()); } return $this->blocks; } public function display(array $context, array $blocks = []): void { foreach ($this->yield($context, $blocks) as $data) { echo $data; } } public function render(array $context): string ob_start(); } else { ob_start(function () { return ''; }); } try { $this->display($context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } yield from $this->template->yieldBlock($name, $context); } public function render(array $context = []): string { return $this->template->render($context); } /** * @return void */ * @throws SyntaxError When an error occurred during compilation * @throws RuntimeError When an error occurred during rendering */ public function render($name, array $context = []): string { return $this->load($name)->render($context); } /** * Displays a template. * } if ('dev' === $appEnv) { // Customize your response object to display the exception details $response = new Response(); $response->setContent($this->twig->render('site/error/show.html.twig', [ 'message' => $exception->getMessage(), ])); // HttpExceptionInterface is a special type of exception that // holds status code and header details $this->priority ??= $dispatcher->getListenerPriority($eventName, $this->listener); $e = $this->stopwatch->start($this->name, 'event_listener'); try { ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); } finally { if ($e->isStarted()) { $e->stop(); } } foreach ($listeners as $listener) { if ($stoppable && $event->isPropagationStopped()) { break; } $listener($event, $eventName, $this); } } /** * Sorts the internal list of listeners for the given event by priority. } else { $listeners = $this->getListeners($eventName); } if ($listeners) { $this->callListeners($listeners, $eventName, $event); } return $event; } try { $this->beforeDispatch($eventName, $event); try { $e = $this->stopwatch->start($eventName, 'section'); try { $this->dispatcher->dispatch($event, $eventName); } finally { if ($e->isStarted()) { $e->stop(); } } * Handles a throwable by trying to convert it to a Response. */ private function handleThrowable(\Throwable $e, Request $request, int $type): Response { $event = new ExceptionEvent($this, $request, $type, $e); $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION); // a listener might have replaced the exception $e = $event->getThrowable(); if (!$event->hasResponse()) { if ($pop = $request !== $this->requestStack->getMainRequest()) { $this->requestStack->push($request); } try { $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST); } finally { if ($pop) { $this->requestStack->pop(); } } if ($hasRun) { throw $e; } $hasRun = true; $kernel->terminateWithException($e, $request); }; } } elseif ($event instanceof ConsoleEvent && $app = $event->getCommand()->getApplication()) { $output = $event->getOutput(); if ($output instanceof ConsoleOutputInterface) { $this->exceptionHandler = null; } try { if (null !== $exceptionHandler) { $exceptionHandler($exception); return; } $handlerException ??= $exception; } catch (\Throwable $handlerException) {|
[2/2]
RuntimeError
|
|---|
Twig\Error\RuntimeError:
An exception has been thrown during the rendering of a template ("Failed to start the session because headers have already been sent by "/home/v0-dev/public_html/vendor/symfony/webpack-encore-bundle/src/Twig/EntryFilesTwigExtension.php" at line 57.").
at /home/v0-dev/public_html/templates/_common/flashes.html.twig:1
at Twig\Template->yield()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:344)
at Twig\Template->display()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:359)
at Twig\Template->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/TemplateWrapper.php:51)
at Twig\TemplateWrapper->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/Extension/CoreExtension.php:1493)
at Twig\Extension\CoreExtension::include()
(/home/v0-dev/public_html/var/cache/dev/twig/3d/3d2442e0a03c3a95b7e1d6a4df20a906.php:99)
at __TwigTemplate_e3f00dbcab5818e3a4cf12433e136f3c->doDisplay()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:388)
at Twig\Template->yield()
(/home/v0-dev/public_html/var/cache/dev/twig/22/22f81da1de1ef9c23dd861ba18579f80.php:54)
at __TwigTemplate_c80d1fa3c85c5a94771a9dbca3a7e992->doDisplay()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:388)
at Twig\Template->yield()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:344)
at Twig\Template->display()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:359)
at Twig\Template->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/TemplateWrapper.php:51)
at Twig\TemplateWrapper->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/Environment.php:334)
at Twig\Environment->render()
(/home/v0-dev/public_html/src/EventListener/ExceptionListener.php:65)
at App\EventListener\ExceptionListener->__invoke()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:220)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/HttpKernel.php:239)
at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/HttpKernel.php:132)
at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:84)
at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::{closure:Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure():78}()
(/home/v0-dev/public_html/vendor/symfony/error-handler/ErrorHandler.php:538)
at Symfony\Component\ErrorHandler\ErrorHandler->handleException()
|
|
[1/2]
RuntimeException
|
|---|
RuntimeException:
Failed to start the session because headers have already been sent by "/home/v0-dev/public_html/vendor/symfony/webpack-encore-bundle/src/Twig/EntryFilesTwigExtension.php" at line 57.
at /home/v0-dev/public_html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:132
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()
(/home/v0-dev/public_html/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php:311)
at Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->getBag()
(/home/v0-dev/public_html/vendor/symfony/http-foundation/Session/Session.php:222)
at Symfony\Component\HttpFoundation\Session\Session->getBag()
(/home/v0-dev/public_html/vendor/symfony/http-foundation/Session/Session.php:232)
at Symfony\Component\HttpFoundation\Session\Session->getFlashBag()
(/home/v0-dev/public_html/vendor/symfony/twig-bridge/AppVariable.php:200)
at Symfony\Bridge\Twig\AppVariable->getFlashes()
(/home/v0-dev/public_html/vendor/twig/twig/src/Extension/CoreExtension.php:1882)
at Twig\Extension\CoreExtension::getAttribute()
(/home/v0-dev/public_html/var/cache/dev/twig/e2/e2682edc6fe1d2018ae057537fb41432.php:49)
at __TwigTemplate_14a30622d8d2425db42ec75e72279362->doDisplay()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:388)
at Twig\Template->yield()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:344)
at Twig\Template->display()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:359)
at Twig\Template->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/TemplateWrapper.php:51)
at Twig\TemplateWrapper->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/Extension/CoreExtension.php:1493)
at Twig\Extension\CoreExtension::include()
(/home/v0-dev/public_html/var/cache/dev/twig/3d/3d2442e0a03c3a95b7e1d6a4df20a906.php:99)
at __TwigTemplate_e3f00dbcab5818e3a4cf12433e136f3c->doDisplay()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:388)
at Twig\Template->yield()
(/home/v0-dev/public_html/var/cache/dev/twig/22/22f81da1de1ef9c23dd861ba18579f80.php:54)
at __TwigTemplate_c80d1fa3c85c5a94771a9dbca3a7e992->doDisplay()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:388)
at Twig\Template->yield()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:344)
at Twig\Template->display()
(/home/v0-dev/public_html/vendor/twig/twig/src/Template.php:359)
at Twig\Template->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/TemplateWrapper.php:51)
at Twig\TemplateWrapper->render()
(/home/v0-dev/public_html/vendor/twig/twig/src/Environment.php:334)
at Twig\Environment->render()
(/home/v0-dev/public_html/src/EventListener/ExceptionListener.php:65)
at App\EventListener\ExceptionListener->__invoke()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:116)
at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:220)
at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php:56)
at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
(/home/v0-dev/public_html/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:139)
at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/HttpKernel.php:239)
at Symfony\Component\HttpKernel\HttpKernel->handleThrowable()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/HttpKernel.php:132)
at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()
(/home/v0-dev/public_html/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:84)
at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::{closure:Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure():78}()
(/home/v0-dev/public_html/vendor/symfony/error-handler/ErrorHandler.php:538)
at Symfony\Component\ErrorHandler\ErrorHandler->handleException()
|