inertiajs / inertia-laravel

The Laravel adapter for Inertia.js.
https://inertiajs.com
MIT License
2.04k stars 227 forks source link

Call `php artisan inertia:start-ssr` not working on Windows #490

Closed ycs77 closed 1 year ago

ycs77 commented 1 year ago

If call the php artisan inertia:start-ssr command on Windows, then get this error:

   Error 

  Call to undefined function Inertia\Commands\pcntl_async_signals()

  at D:\inertia-test\vendor\inertiajs\inertia-laravel\src\Commands\StartSsr.php:62
     58▕
     59▕         $stop = function () use ($process) {
     60▕             $process->stop();
     61▕         };
  ➜  62▕         pcntl_async_signals(true);
     63▕         pcntl_signal(SIGINT, $stop);
     64▕         pcntl_signal(SIGQUIT, $stop);
     65▕         pcntl_signal(SIGTERM, $stop);
     66▕

  1   D:\inertia-test\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36
      Inertia\Commands\StartSsr::handle()

  2   D:\inertia-test\vendor\laravel\framework\src\Illuminate\Container\Util.php:41
      Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

The bug is from inertia-laravel v0.6.7 and Windows because PCNTL extension is not available on Windows, see https://www.php.net/manual/en/intro.pcntl.php

reinink commented 1 year ago

@ycs77 Hey thanks for reporting, this has been fixed: https://github.com/inertiajs/inertia-laravel/pull/492