jeudi 2 janvier 2020

Unexpected identifier in Nesk/Rialto (Puppeteer)

I'm running Puppeteer via Puphpeteer, in one of my Laravel 5.8.35 commands. It works perfectly when I run it via the console (e.g. php artisan CommandName). However, when this same command runs via the scheduled cron (via app\Console\Kernel.php), I get the following error:

Nesk\Rialto\Exceptions\Node\FatalException Unexpected identifier - the error line is: $puppeteer = new Puppeteer;

A fuller code excerpt is:

<?php

namespace App\Console\Commands;

use Nesk\Puphpeteer\Puppeteer;
use Nesk\Rialto\Data\JsFunction;
use Symfony\Component\DomCrawler\Crawler;

class ScrapeRezdy extends Command{
    protected $signature = 'SomeCommand';
    protected $description = 'Command description';
    public function __construct(){parent::__construct();}
    public function handle()    {

        $puppeteer = new Puppeteer;
        $browser = $puppeteer->launch();
    ...

It actually worked perfectly previously via the cron on my old server, but on my new AWS server it's having the problem mentioned above. How can I fix this? Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire