rialto-php / rialto

Manage Node resources with PHP
MIT License
170 stars 80 forks source link

chunksLeft.padStart is not a function #16

Closed rhergenreder closed 5 years ago

rhergenreder commented 5 years ago

Hello, i came across an issue when using puphpeteer, which is probably caused by rialto:

use Nesk\Puphpeteer\Puppeteer;
$puppeteer = new Puppeteer;

Runnig this php code, produces the following php errors:

<br />
<b>Fatal error</b>:  Uncaught Nesk\Rialto\Exceptions\Node\FatalException: chunksLeft.padStart is not a function in (...)/vendor/nesk/rialto/src/ProcessSupervisor.php:307
Stack trace:
#0 (...)/vendor/nesk/rialto/src/ProcessSupervisor.php(387): Nesk\Rialto\ProcessSupervisor-&gt;checkProcessStatus()
#1 (...)/vendor/nesk/rialto/src/ProcessSupervisor.php(167): Nesk\Rialto\ProcessSupervisor-&gt;executeInstruction(Object(Nesk\Rialto\Instruction), false)
#2 (...): Nesk\Rialto\ProcessSupervisor-&gt;__destruct()
#5 {main}
  thrown in <b>(...)/vendor/nesk/rialto/src/ProcessSupervisor.php</b> on line <b>307</b><br />

The error is probably referred to /src/node-process/Connection.js#L112

rhergenreder commented 5 years ago

Oh this was my fault, upgrading node to at least 8.0 solves this issue. See also: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart#Browser_compatibility