提问人:Nida Z 提问时间:11/14/2023 更新时间:11/14/2023 访问量:17
使用 Puppeteer 文档到 pdf 为 Docusaurus 站点创建 PDF 时出现“ProtocolError: Runtime.callFunctionOn timed out”
"ProtocolError: Runtime.callFunctionOn timed out" while creating PDF for Docusaurus site using Puppeteer docs-to-pdf
问:
我正在尝试使用 docs-to-pdf 工具从 Docusaurus 站点生成 PDF。我成功地为一个较小的网站做到了这一点,但我在一个中型网站上遇到了这个错误。我找不到增加超时的方法或解决此错误的方法。我搜索了一下,但发现即使在增加超时后,人们也有同样的错误。
附言我不精通 TS/JS。
[14.11.2023 12:47.56.629] [LOG] Success
[14.11.2023 12:47.56.630] [LOG] Start generating PDF...
[14.11.2023 12:47.56.631] [LOG] Generate cover...
[14.11.2023 12:47.56.631] [LOG] Start generating TOC...
[14.11.2023 12:47.56.646] [LOG] Restructuring the html of a document...
[14.11.2023 12:47.57.939] [LOG] Scroll to the bottom of the page...
[14.11.2023 12:50.57.954] [ERROR] ProtocolError: Runtime.callFunctionOn timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
at <instance_members_initializer> (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\common\CallbackRegistry.js:96:14)
at new Callback (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\common\CallbackRegistry.js:100:16)
at CallbackRegistry.create (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\common\CallbackRegistry.js:32:26)
at Connection._rawSend (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\Connection.js:91:26)
at CdpCDPSession.send (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\CDPSession.js:78:33)
at #evaluate (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:211:50)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async ExecutionContext.evaluate (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\ExecutionContext.js:126:16)
at async IsolatedWorld.evaluate (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\cdp\IsolatedWorld.js:128:16)
at async CdpPage.evaluate (C:\Users\Nida\AppData\Roaming\npm\node_modules\docs-to-pdf\node_modules\puppeteer-core\lib\cjs\puppeteer\api\Page.js:900:20)
我尝试了成功生成 PDF 的相同命令,但改用了中型网站,这导致了错误。此命令:
npx docs-to-pdf docusaurus --initialDocURLs="https://docs.apimatic.io" --contentSelector="article" --paginationSelector="a.pagination-nav__link.pagination-nav__link--next"
我没有在我的 docusaurus 代码中更改任何内容,除了使用命令安装此工具
npm install -g docs-to-pdf
答: 暂无答案
评论