slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.49k stars 1.37k forks source link

The exported pdf is blank in version 0.49.12 and 0.49.13 #1729

Closed fightingxiaoxiao closed 4 months ago

fightingxiaoxiao commented 4 months ago

Describe the bug

Although the default markdown file can be exported correctly, the reduced markdown file is exported as a blank PDF:

---
# You can also start simply with 'default'
theme: seriph
# random image from a curated Unsplash collection by Anthony
# like them? see https://unsplash.com/collections/94734566/slidev
background: https://cover.sli.dev
# some information about your slides (markdown enabled)
title: Welcome to Slidev
info: |
  ## Slidev Starter Template
  Presentation slides for developers.

  Learn more at [Sli.dev](https://sli.dev)
# apply unocss classes to the current slide
class: text-center
# https://sli.dev/custom/highlighters.html
highlighter: shiki
# https://sli.dev/guide/drawing
drawings:
  persist: false
# slide transition: https://sli.dev/guide/animations#slide-transitions
transition: slide-left
# enable MDC Syntax: https://sli.dev/guide/syntax#mdc-syntax
mdc: true
---

---
layout: center
class: text-center
---

# Learn More

[Documentation](https://sli.dev) · [GitHub](https://github.com/slidevjs/slidev) · [Showcases](https://sli.dev/showcases.html)

<PoweredBySlidev mt-10 />

Minimal reproduction

export PDF under slidev 0.49.11:

Snipaste_2024-07-04_20-11-51

export PDF under slidev 0.49.12:

Snipaste_2024-07-04_20-10-31

here is the package.json:

{
  "name": "slidev",
  "type": "module",
  "private": true,
  "scripts": {
    "build": "slidev build",
    "dev": "slidev --open",
    "export": "slidev export"
  },
  "dependencies": {
    "@slidev/cli": "0.49.12",
    "@slidev/theme-default": "latest",
    "@slidev/theme-seriph": "latest",
    "vue": "^3.4.30"
  },
  "devDependencies": {
    "playwright-chromium": "^1.45.1"
  }
}

Environment

KermanX commented 4 months ago

As a workaround, you can use export the slides with --wait-until networkidle:

$ npm run export -- --wait-until networkidle
# or
$ pnpm export --wait-until networkidle