Skip to content

Navigation timeout exceeded error #35

Description

@coxfrederic

Hi,

I'm using this wonderful library to print out some labels that are being created in HTML.

We create the HTML and it contains just simple texts and a barcode SVG but nothing too fancy. Some icons are loaded through fontawesome.

// Need to include fontawesome for icons that are used

$labelsHtml .= '<script src="https://kit.fontawesome.com/5084f22b83.js" crossorigin="anonymous"></script>';

and when the HTML is populated we set it like this:

$input = new StringInput();
$input->setHtml($labelsHtml);

 $converter = new Converter($input, new EmbedOutput()); $converter->setOptions([
 'printBackground' => true,
 'landscape' => true,
 'width' => $height,
 'height' => $width,
 'margin' => ['top' => '5mm', 'right' => '5mm', 'bottom' => '5mm', 'left' => '5mm']
]);

$output = $converter->convert();
$output->embed('labels' . DateHelper::now(false, 'd-m-Y-H-i-s') . '.pdf');

We have been using this for quite some time but recently been noticing it takes a lot of time. On the same link we got a timeout earlier today, now it is working, but since fontawesome is loading very fast for me I'm wondering if that is the delay.

Since we set HTML, and there is nothing external except fontawesome, what could be triggering this timeout?
Also, is there something we need or can do to speed up the process? Like for example in PHP kill the process or something?

Trying to figure out what might be causing the delay.

Any help is appreciated, see the error below:

Spiritix\Html2Pdf\ConverterException /var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/src/Spiritix/Html2Pdf/Converter.php in Spiritix\Html2Pdf\Converter::convert Binary error: node:internal/process/promises:246 triggerUncaughtException(err, true /* fromPromise */); ^ TimeoutError: Navigation timeout of 30000 ms exceeded at /var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/node_modules/puppeteer/lib/LifecycleWatcher.js:100:111 at async DOMWorld.setContent (/var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/node_modules/puppeteer/lib/DOMWorld.js:152:23) at async Page.setContent (/var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/node_modules/puppeteer/lib/Page.js:482:9) at async Converter._convert (/var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/lib/Converter.js:76:9) at async Converter.run (/var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/lib/Converter.js:37:24) at async /var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/index.js:23:20 -- ASYNC -- at Frame. (/var/OurPlatform/vendor/spiritix/php-chrome-html2pdf/node_modules/puppeteer/lib/helper.js:94:19) at Page.setContent (/var/OurPlatform/vendor/spiritix/php-chrome-html2p...php

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions