error on composer run dev
Laravel Package Version
1.2
Laravel Version
12.32
PHP Version
8.4
Database Driver & Version
pgsql
Description
php artisan pail -vv ─╯
INFO Tailing application logs. Press Ctrl+C to exit
Use -v|-vv to show more details
JsonException
Syntax error
at vendor/laravel/pail/src/ValueObjects/MessageLogged.php:30 26▕ / 27▕ public static function fromJson(string $json): static 28▕ { 29▕ /* @var array{message: string, context: array{__pail: array{origin: array{trace: array<int, array{file: string, line: int}>|null, type: string, queue: string, job: string, command: string, method: string, path: string, auth_id: ?string, auth_email: ?string}}, exception: array{class: string, file: string}}, level_name: string, datetime: string} $array */ ➜ 30▕ $array = json_decode($json, true, 512, JSON_THROW_ON_ERROR); 31▕ 32▕ [ 33▕ 'message' => $message, 34▕ 'datetime' => $datetime,
1 vendor/laravel/pail/src/ValueObjects/MessageLogged.php:30
2 vendor/laravel/pail/src/ProcessFactory.php:42 Laravel\Pail\ValueObjects\MessageLogged::fromJson()
3 [internal]:0 Laravel\Pail\ProcessFactory::{closure:{closure:Laravel\Pail\ProcessFactory::run():26}:42}() 4 vendor/laravel/framework/src/Illuminate/Collections/Arr.php:778
5 vendor/laravel/framework/src/Illuminate/Collections/Collection.php:814 Illuminate\Support\Arr::map()
6 vendor/laravel/pail/src/ProcessFactory.php:42 Illuminate\Support\Collection::map()
7 vendor/symfony/process/Process.php:1311 Laravel\Pail\ProcessFactory::{closure:Laravel\Pail\ProcessFactory::run():26}()
8 vendor/symfony/process/Process.php:1411 Symfony\Component\Process\Process::{closure:Symfony\Component\Process\Process::buildCallback():1304}()
9 vendor/symfony/process/Process.php:452 Symfony\Component\Process\Process::readPipes()
10 vendor/symfony/process/Process.php:251 Symfony\Component\Process\Process::wait()
11 vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php:33 Symfony\Component\Process\Process::run()
12 vendor/laravel/framework/src/Illuminate/Process/PendingProcess.php:258 Illuminate\Support\HigherOrderTapProxy::__call()
13 vendor/laravel/pail/src/ProcessFactory.php:24 Illuminate\Process\PendingProcess::run()
14 vendor/laravel/pail/src/Console/Commands/PailCommand.php:86 Laravel\Pail\ProcessFactory::run()
15 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 Laravel\Pail\Console\Commands\PailCommand::handle()
16 vendor/laravel/framework/src/Illuminate/Container/Util.php:43 Illuminate\Container\BoundMethod::{closure:Illuminate\Container\BoundMethod::call():35}()
17 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:96 Illuminate\Container\Util::unwrapIfClosure()
18 vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35 Illuminate\Container\BoundMethod::callBoundMethod()
19 vendor/laravel/framework/src/Illuminate/Container/Container.php:836 Illuminate\Container\BoundMethod::call()
20 vendor/laravel/framework/src/Illuminate/Console/Command.php:211 Illuminate\Container\Container::call()
21 vendor/symfony/console/Command/Command.php:318 Illuminate\Console\Command::execute()
22 vendor/laravel/framework/src/Illuminate/Console/Command.php:180 Symfony\Component\Console\Command\Command::run()
23 vendor/symfony/console/Application.php:1110 Illuminate\Console\Command::run()
24 vendor/symfony/console/Application.php:359 Symfony\Component\Console\Application::doRunCommand()
25 vendor/symfony/console/Application.php:194 Symfony\Component\Console\Application::doRun()
26 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:197 Symfony\Component\Console\Application::run()
27 vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1235 Illuminate\Foundation\Console\Kernel::handle()
28 artisan:13 Illuminate\Foundation\Application::handleCommand()
Steps To Reproduce
run: composer run dev
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hi, I'm experiencing what seems to be the same issue, or at least an error in the same file and line (MessageLogged.php:30) I'm working on a fairly large project, and this issue appears to happen randomly. Most of the time, I notice it when I return to my PC after leaving the site inactive for a while.
I can't provide the code that's causing it because the logs only reference the Laravel framework and Pail, as you can see.
Syntax error {"exception":"[object] (JsonException(code: 4): Syntax error at /home/simone/project/vendor/laravel/pail/src/ValueObjects/MessageLogged.php:30) [stacktrace] #0 /home/simone/project/vendor/laravel/pail/src/ValueObjects/MessageLogged.php(30): json_decode() #1 /home/simone/project/vendor/laravel/pail/src/ProcessFactory.php(42): Laravel\\Pail\\ValueObjects\\MessageLogged::fromJson() #2 [internal function]: Laravel\\Pail\\ProcessFactory->Laravel\\Pail\\{closure}() #3 /home/simone/project/vendor/laravel/framework/src/Illuminate/Collections/Arr.php(749): array_map() #4 /home/simone/project/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(805): Illuminate\\Support\\Arr::map() #5 /home/simone/project/vendor/laravel/pail/src/ProcessFactory.php(42): Illuminate\\Support\\Collection->map() #6 /home/simone/project/vendor/symfony/process/Process.php(1311): Laravel\\Pail\\ProcessFactory->Laravel\\Pail\\{closure}() #7 /home/simone/project/vendor/symfony/process/Process.php(1411): Symfony\\Component\\Process\\Process->Symfony\\Component\\Process\\{closure}() #8 /home/simone/project/vendor/symfony/process/Process.php(452): Symfony\\Component\\Process\\Process->readPipes() #9 /home/simone/project/vendor/symfony/process/Process.php(251): Symfony\\Component\\Process\\Process->wait() #10 /home/simone/project/vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php(33): Symfony\\Component\\Process\\Process->run() #11 /home/simone/project/vendor/laravel/framework/src/Illuminate/Process/PendingProcess.php(258): Illuminate\\Support\\HigherOrderTapProxy->__call() #12 /home/simone/project/vendor/laravel/pail/src/ProcessFactory.php(24): Illuminate\\Process\\PendingProcess->run() #13 /home/simone/project/vendor/laravel/pail/src/Console/Commands/PailCommand.php(86): Laravel\\Pail\\ProcessFactory->run() #14 /home/simone/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Laravel\\Pail\\Console\\Commands\\PailCommand->handle() #15 /home/simone/project/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #16 /home/simone/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\\Container\\Util::unwrapIfClosure() #17 /home/simone/project/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod() #18 /home/simone/project/vendor/laravel/framework/src/Illuminate/Container/Container.php(754): Illuminate\\Container\\BoundMethod::call() #19 /home/simone/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\\Container\\Container->call() #20 /home/simone/project/vendor/symfony/console/Command/Command.php(318): Illuminate\\Console\\Command->execute() #21 /home/simone/project/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\\Component\\Console\\Command\\Command->run() #22 /home/simone/project/vendor/symfony/console/Application.php(1092): Illuminate\\Console\\Command->run() #23 /home/simone/project/vendor/symfony/console/Application.php(341): Symfony\\Component\\Console\\Application->doRunCommand() #24 /home/simone/project/vendor/symfony/console/Application.php(192): Symfony\\Component\\Console\\Application->doRun() #25 /home/simone/project/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\\Component\\Console\\Application->run() #26 /home/simone/project/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle() #27 {main} "}
Laravel 12.33.0 - PHP 8.3 - Ubuntu 24.04.02 LTS
I'm also experiencing a similar issue. It seems to happens when reloading a file with a syntax error. Doesn't happens every time though
finally, i found solution,
sudo nano /etc/sysctl.conf
edit with this:
fs.inotify.max_user_watches=524288
fs.inotify.max_user_instances=512
continue to restart
sudo sysctl -p
CMIWW