diff --git a/composer.json b/composer.json index fa662bc5..2b889366 100644 --- a/composer.json +++ b/composer.json @@ -22,11 +22,11 @@ "ext-json": "*", "ext-mbstring": "*", "monolog/monolog": "^2.3", - "spatie/ignition": "^1.2.4", + "spatie/ignition": "^1.4.1", "spatie/flare-client-php": "^1.0.1", "symfony/console": "^5.0|^6.0", "symfony/var-dumper": "^5.0|^6.0", - "illuminate/support": "^8.77|^9.0" + "illuminate/support": "^8.77|^9.27" }, "require-dev": { "filp/whoops": "^2.14", diff --git a/src/Renderers/ErrorPageRenderer.php b/src/Renderers/ErrorPageRenderer.php index e1039850..d66f4cba 100644 --- a/src/Renderers/ErrorPageRenderer.php +++ b/src/Renderers/ErrorPageRenderer.php @@ -15,6 +15,17 @@ class ErrorPageRenderer { public function render(Throwable $throwable): void { + $vitejsAutoRefresh = ''; + + if (class_exists('Illuminate\Foundation\Vite')) { + + $vite = app(\Illuminate\Foundation\Vite::class); + + if (is_file($vite->hotFile())) { + $vitejsAutoRefresh = $vite->__invoke([]); + } + } + app(Ignition::class) ->resolveDocumentationLink( fn (Throwable $throwable) => (new LaravelDocumentationLinkFinder())->findLinkForThrowable($throwable) @@ -25,6 +36,7 @@ public function render(Throwable $throwable): void ->setContextProviderDetector(new LaravelContextProviderDetector()) ->setSolutionTransformerClass(LaravelSolutionTransformer::class) ->applicationPath(base_path()) + ->addCustomHtmlToHead($vitejsAutoRefresh) ->renderException($throwable); } }