From a6bcaeb73ae329c00b55b2169db623e66b454858 Mon Sep 17 00:00:00 2001 From: Johannes Reiter Date: Wed, 17 Dec 2025 09:52:15 +0100 Subject: [PATCH 1/2] Improve error handling for entry points Updated error message for missing entry point and fixed file path handling. --- src/Encore.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Encore.php b/src/Encore.php index b2243d4..5cb0b01 100644 --- a/src/Encore.php +++ b/src/Encore.php @@ -136,7 +136,7 @@ public function getAssets(string $name, string $entryPoint, array $config): arra $entrypoints = $this->getEntrypoint($name); if (!isset($entrypoints['entrypoints'][$entryPoint])) { - throw new \LogicException('No entry point found in the entrypoint.js'); + throw new \LogicException('EntryPoint: ' . $entryPoint . ' not found in entrypoint.json.' . PHP_EOL .' Available entry points are: ' . implode(', ', array_keys($entrypoints['entrypoints'])));; } $enqueue = $entrypoints['entrypoints'][$entryPoint]; @@ -222,7 +222,7 @@ public function getEntrypoint(string $dir): array return $this->entryPointCache[$this->outputPath][$dir]; } - $filepath = $this->rootPath . '/entrypoints.json'; + $filepath = trailingslashit($this->rootPath) . 'entrypoints.json'; if (!file_exists($filepath)) { throw new \LogicException(sprintf('Entrypoint %s does not exist.', $filepath)); From b3731665668c045f245469c8c65add10d81c9c4c Mon Sep 17 00:00:00 2001 From: Johannes Reiter Date: Fri, 9 Jan 2026 11:25:12 +0100 Subject: [PATCH 2/2] =?UTF-8?q?[TASK]=20fix=20coding=20style=C2=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Encore.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Encore.php b/src/Encore.php index 5cb0b01..a65f1b0 100644 --- a/src/Encore.php +++ b/src/Encore.php @@ -136,7 +136,12 @@ public function getAssets(string $name, string $entryPoint, array $config): arra $entrypoints = $this->getEntrypoint($name); if (!isset($entrypoints['entrypoints'][$entryPoint])) { - throw new \LogicException('EntryPoint: ' . $entryPoint . ' not found in entrypoint.json.' . PHP_EOL .' Available entry points are: ' . implode(', ', array_keys($entrypoints['entrypoints'])));; + throw new \LogicException( + 'EntryPoint: ' . $entryPoint . ' not found in entrypoint.json. ' . \PHP_EOL . + 'Available entry points are: ' . implode(', ', array_keys( + $entrypoints['entrypoints'] + )) + ); } $enqueue = $entrypoints['entrypoints'][$entryPoint];