slidev: can not export to pdf

I try to use npx slidev export to export pdf, but it always fails on:

 ▲ rendering █████░░░░░░░░░░░░░░░░░░░░░░░░░ 1/6page.goto: Timeout 30000ms exceeded.
=========================== logs ===========================
navigating to "http://localhost:12445/1?print", waiting until "networkidle"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
Error
    at Object.captureStackTrace (/Users/cwh/Mission/coding/slidev/node_modules/playwrigh)
    at Connection.sendMessageToServer (/Users/cwh/Mission/coding/slidev/node_modules/pla)
    at Proxy.<anonymous> (/Users/cwh/Mission/coding/slidev/node_modules/playwright-chrom)
    at /Users/cwh/Mission/coding/slidev/node_modules/playwright-chromium/lib/client/fram5
    at Frame._wrapApiCall (/Users/cwh/Mission/coding/slidev/node_modules/playwright-chro)
    at Frame.goto (/Users/cwh/Mission/coding/slidev/node_modules/playwright-chromium/lib)
    at /Users/cwh/Mission/coding/slidev/node_modules/playwright-chromium/lib/client/page0
    at Page._attributeToPage (/Users/cwh/Mission/coding/slidev/node_modules/playwright-c)
    at Page.goto (/Users/cwh/Mission/coding/slidev/node_modules/playwright-chromium/lib/)
    at go (/Users/cwh/Mission/coding/slidev/node_modules/@slidev/cli/dist/export-WGBEP3O)
    at exportSlides (/Users/cwh/Mission/coding/slidev/node_modules/@slidev/cli/dist/expo)
    at async Object.handler (/Users/cwh/Mission/coding/slidev/node_modules/@slidev/cli/d{
  name: 'TimeoutError'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 33 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Is it possible to increase the timeout a bit?

$ slidev export --timeout 3000

You can also try to disable the remote assets downloading

---
remoteAssets: false
---

How did you turn on a global proxy?

I have the same timeout issue, when running the build … export to PDF works fine

@antfu Is it possible to increase the timeout a bit?

It’s slow to access some foreign resources in some coutries, so a network proxy for low latency is required to meet the timeout limitation.

Add proxy to playwright.

node_modules@slidev\cli\dist\export-LOKLMK66.js 67:

  const browser = await chromium.launch({
    proxy: {
        server: 'http://127.0.0.1:7890'
    }
});

I just turn the monaco editor config to false, and everything works 😃

twitter widget.js is injected into index.html by default.

Only when you use <Tweet/> in your slides, which in this case, it’s used in the starter template.

Maybe consider increasing the exception tolerance to let it go?

I don’t know. I don’t think it makes sense to export the slides with some images / content failed to load. But maybe we could improve the error log to show the pending resources that causes the failing.

I already have the remoteAssets: false 😃 … But sometimes it runs into the timeout … so no idea why

Might due to the Twitter scripts (was ‘sync’ loading). Changed to async in v0.16.0, can you guys try the new version out and see if it’s a fix for you? Thanks

I have the same error with the default install : • yarn create slidev (don’t run install dependencies & start) • yarn install • yarn export

cf : https://fr.sli.dev/guide/#creation-de-votre-premiere-presentation The default slide content is the same as default slide when we create an new project.

OS : Windows Node : v.14.16.1 Npm : v.6.14.12 Yarn : 1.22.10