Closed leonimurilo closed 5 years ago
This worked for me too. Thanks!
I'm trying to run this locally, and it fails.
@leonimurilo can you provide me maybe with an environment where it is reproduced?
What kind of content you're trying to convert?
I'm getting Error: Protocol error (Page.navigate): Cannot navigate to invalid URL undefined
if I'm using your solution.
Don't know about @leonimurilo, but I'm using it on a Windows 10 machine with nodejs v10.13. These are the installed versions of the dependencies: node-sass: 4.11.0
, pug: 2.0.3
and puppeteer: 1.14.0
What kind of content are you trying to render? Is it HTML? Can you try to maybe fork the repo and run the tests? I'm just not able to reproduce this.
My environment was: macOS Mojave node.js >=8.9.0 I was using @babel
I was rendering a simple html.
Can you please provide an environment where it is reproduced?
Closing for now, as no reproduction env is supplied (I couldn't reproduce the issue).
I was trying to use the lib but in every test the output was a blank pdf.
I tried to debug the code and the solution I found was replacing
await page.goto('data:text/html,${renderedTemplate}/', { waitUntil: ['load', 'domcontentloaded', 'networkidle0'] });
by
await page.setContent(renderedTemplate);
I don't know if I was using different versions of the dependencies but I am just sharing the solution I found.