jupyter-book icon indicating copy to clipboard operation
jupyter-book copied to clipboard

Navigation Timeout error when building book pdf

Open giswqs opened this issue 2 years ago • 6 comments

Describe the bug

context I was able to build the book pdf with pyppeteer in the past, but now it throws pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 30000 ms exceeded. I could not find a solution on the pyppeteer repo. I am not sure if this is a JupyterBook or pyppeteer issue.

$ jupyter-book build . --builder pdfhtml

image

Reproduce the bug

$ jupyter-book build . --builder pdfhtml

List your environment

Jupyter Book : 0.12.3 External ToC : 0.2.3 MyST-Parser : 0.15.2 MyST-NB : 0.13.2 Sphinx Book Theme : 0.1.9 Jupyter-Cache : 0.4.3 NbClient : 0.5.13

giswqs avatar May 19 '22 03:05 giswqs

I'm running into the same problem when trying to build the book at https://github.com/xpqz/learnapl

anrddh avatar Jun 20 '22 02:06 anrddh

This was with v13.0 of Jupyter Book and v1.0.3 of pyppeteer. I seemed to have fixed the problem by simply editing line 50 of pdf.py from

    await page.goto(f"file:///{html_file}", {"waitUntil": ["networkidle2"]})

to

    await page.goto(f"file:///{html_file}", {"timeout": 0, "waitUntil": ["networkidle2"]})

I'm not intimately familiar with the internal workings of Jupyter Book, or with pyppeteer so I'm not sure if this is a "good" fix or not. Would appreciate it if a core contributor can find the bandwidth to take a look at this.

anrddh avatar Jun 20 '22 20:06 anrddh

Nice fix @anrddh. Solved issue for me!

Commenting just so I get updates on this issue :)

ebridge2 avatar Nov 15 '22 10:11 ebridge2

This was with v13.0 of Jupyter Book and v1.0.3 of pyppeteer. I seemed to have fixed the problem by simply editing line 50 of pdf.py from

    await page.goto(f"file:///{html_file}", {"waitUntil": ["networkidle2"]})

to

    await page.goto(f"file:///{html_file}", {"timeout": 0, "waitUntil": ["networkidle2"]})

I'm not intimately familiar with the internal workings of Jupyter Book, or with pyppeteer so I'm not sure if this is a "good" fix or not. Would appreciate it if a core contributor can find the bandwidth to take a look at this.

May I ask where is the file is so I can try to circumvent this issue. Many thinks in advance.

kwccoin avatar Sep 18 '23 06:09 kwccoin

May I ask where is the file is so I can try to circumvent this issue. Many thinks in advance.

@kwccoin If you're like me and don't know where exactly the package is installed, you can do the following from Python:

import jupyter_book.pdf
jupyter_book.pdf.__file__
> '/opt/homebrew/lib/python3.11/site-packages/jupyter_book/pdf.py'

zouharvi avatar Sep 20 '23 15:09 zouharvi

Thanks! It work now. But I guess it might need an option in the config file, otherwise we have to change it everytime we upgrade our systems. But it works and hence once again many many thanks.

kwccoin avatar Sep 22 '23 04:09 kwccoin