Open subooom opened 12 months ago
Hi!
I tried your example with minor changes (i use macos/linux), and there was no issues:
<?php
require __DIR__ . '/../vendor/autoload.php';
use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
$puppeteer = new Puppeteer([
'executable_path' => 'node',
'debug' => true
]);
$browser = $puppeteer->launch();
$page = $browser->newPage();
$page->setContent('');
// Run JavaScript code within the page
$result = $page->evaluate(JsFunction::createWithBody(/** @lang JavaScript */'
return {test: 23}
'));
printf('Result: %s', print_r($result, true));
$browser->close();
/opt/homebrew/bin/php /Users/xtrime/PhpstormProjects/zoon/puphpeteer/examples/03_execute_in_node.php
Result: Array
(
[test] => 23
)
Describe the bug Getting a
Starting inspector on 127.0.0.1:9229 failed: unknown error
Reproducible example
Expected behavior
$result
to be{test: 23}
Generated logs
Environment (please complete the following information):
What I've done so far
netstat -ano | findstr :9229
returnsTCP 127.0.0.1:54268 127.0.0.1:9229 SYN_SENT 6532
Get-Process -Id 6532
returnsHandles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName 2308 70 197948 244980 210.34 6532 1 chrome
My Node package manager is: