diff --git a/src/Runtime/BlazeRuntime.php b/src/Runtime/BlazeRuntime.php index 39a09281..6d2aec81 100644 --- a/src/Runtime/BlazeRuntime.php +++ b/src/Runtime/BlazeRuntime.php @@ -20,7 +20,6 @@ class BlazeRuntime public readonly Application $app; public readonly Debugger $debugger; public readonly Compiler $compiler; - protected ViewErrorBag $errors; public string $compiledPath; @@ -202,12 +201,13 @@ public function getConsumableData(string $key, mixed $default = null): mixed } /** - * Lazy-load $errors since middleware sets them after BlazeRuntime is constructed. + * Always read $errors fresh from the view factory rather than caching on the + * singleton — a cached value goes stale in long-lived processes (Octane, etc.). */ public function __get(string $name): mixed { if ($name === 'errors') { - return $this->errors ??= $this->env->shared('errors') ?? new ViewErrorBag; + return $this->env->getShared()['errors'] ?? new ViewErrorBag; } throw new \InvalidArgumentException("Property {$name} does not exist");