Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HtmlPdf.create() page navigate failed #135

Open
bettysteger opened this issue Mar 28, 2018 · 10 comments
Open

HtmlPdf.create() page navigate failed #135

bettysteger opened this issue Mar 28, 2018 · 10 comments

Comments

@bettysteger
Copy link

I have a question, because i am creating a HTML file with some file:// links to different assets.

I am using the base-tag in the head for linking to another directory, like this:

<base href="file:///Users/Betty/some_project/app/www/">

when I open the HTML file every asset is loaded correctly and also before, when defining this as base in the options of the html-pdf node module (with phantomjs) this worked just fine..

I am not sure why I get this error, and I hope maybe someone can give me an hint :)

Error: HtmlPdf.create() page navigate failed.
    at /Users/Betty/redox/some_project/screens-generator/node_modules/html-pdf-chrome/lib/src/index.js:174:19

The create works without the file links, but then I would have no JS/CSS/images.

@westy92
Copy link
Owner

westy92 commented Apr 2, 2018

Could you please provide:

  • platform (Windows 10 x64, Ubuntu x64 16.04, macOS 10.12.1, etc.)
  • Node.js version (6.11.4, 8.7.0, etc.)
  • Chrome/chromium version (61.0.3163.100 (Official Build) (64-bit), etc.)
  • html-pdf-chrome version (0.5.0, etc.)

Thank you!

@bettysteger
Copy link
Author

@westy92 Sorry, I am using:

  • macOS 10.12.6
  • node 8.7.0
  • Chrome 65.0.3325.181 (Offizieller Build) (64-Bit)
  • html-pdf-chrome 0.5.0

@bettysteger
Copy link
Author

@westy92 also tested on

  • Ubuntu 17.10 (Kernel 4.13.0-19)
  • Node 7.8.0
  • Chromium 65.0.3325.181 (Official Build) 64bit
  • html-pdf-chrome 0.5.0

same error

@vaibhav15s
Copy link

vaibhav15s commented Apr 4, 2018

I also got the same issue. This is happening for certain URL, not for all.
Can this be related to site certificate or loading time?
This is the error in console:
(node:13693) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 4): Error: HtmlPdf.create() page navigate failed.
(node:13693) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


Error: HtmlPdf.create() page navigate failed.
at /home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:174:19
at Generator.next ()
at /home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:7:71
at __awaiter (/home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:3:12)
at throwIfCanceledOrFailed (/home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:169:12)
at /home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:151:19
at Generator.next ()
at /home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:7:71
at __awaiter (/home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:3:12)
at afterNavigate (/home/nadeem/node_modules/html-pdf-chrome/lib/src/index.js:149:12)

@vaibhav15s
Copy link

Hi @westy92
can you please take a look. I have copied the stack trace above.

@felipetpin
Copy link

Have any of you guys solved this issue?

@bvanderdrift
Copy link

bvanderdrift commented Jun 28, 2018

Rendering pure HTML. No external resources loaded. On local machine working, on other machines and our staging environment it is not working.

Error is occuring on

  • Debian 8 (Jesse)
  • Node 8.11.2
  • Chrome Stable 67.0.3396.99-1
  • html-pdf-chrome 0.5.0

@lauraluca
Copy link

@westy92 any known issue in opening a page with a certificate issue? it's working just fine if the certificate is valid

@laurentdebricon
Copy link

for me it happens if i render twice the same url

@gregbown
Copy link

gregbown commented May 21, 2020

Unsure if this is best location for my issue regarding HtmlPdf.create() page navigate failed error.
I am using chromium version 81.0.4044.138 running in Debian docker container. I can generate .pdf fine as long as I do not have external style sheet links. I have tried every which way to get the CSS path to resolve. The page renders perfectly if I serve it locally. I am passing it into HtmlPdf.create() as a rendered template though. Any advice or recommendations?

I am running my node/htmlpdf app locally so maybe this is an issue of the chromium docker not being able to connect to host machine and it will resolve if I run the node/htmlpdf app in its container? I verified from inside chromium container I cannot access the css file with curl. Am I answering my own question here, well yes, assuming chromium is trying to render my html page in a DOM and the CSS path is inaccessible.

As a work around I am using inline-css to convert external CSS to inline inside the markup and then stripping the css file link tag out of the page, then pdf generates without error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants