slidevjs / slidev

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

Error with icon while exporting to PDF #1742

Open Mrbibi38 opened 2 months ago

Mrbibi38 commented 2 months ago

Describe the bug

Cannot export an icon into the PDF. The icon is from @iconify-json/logos. Maybe this is not a bug and this is incompatible but didn't find any notice about that.

Minimal reproduction Steps to reproduce the behavior:

  1. Create a slide
  2. Include an icons from from @iconify-json/logos Example:
    Zabbix Icon:
    <logos-zabbix/>
  3. Go to the terminal and try to export as PDF
  4. Wait and get the following error:

    slidev export .\tasksoftheweek.md
    ●■▲
    Slidev  v0.49.16 (global)
    
    theme       @slidev/theme-apple-basic
    css engine  unocss
    entry       C:\Users\johndoe\OneDrive - John\Documents\slidev\tasksoftheweek.md
    ◆ rendering...09:28:40 [vite] Pre-transform error: Icon `logos/zabbix` not found
    ■ rendering...09:28:40 [vite] Internal server error: Icon `logos/zabbix` not found
      at generateComponent (file:///C:/Users/johndoe/AppData/Roaming/npm/node_modules/@slidev/cli/node_modules/unplugin)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async LoadPluginContext.load (file:///C:/Users/johndoe/AppData/Roaming/npm/node_modules/@slidev/cli/node_modul)
      at async PluginContainer.load (file:///C:/Users/johndoe/AppData/Roaming/npm/node_modules/@slidev/cli/node_modules)
      at async loadAndTransform (file:///C:/Users/johndoe/AppData/Roaming/npm/node_modules/@slidev/cli/node_modules/vit)
      at async viteTransformMiddleware (file:///C:/Users/johndoe/AppData/Roaming/npm/node_modules/@slidev/cli/node_modu)
    ✓ exported to ./tasksoftheweek-export.pdf

Environment

KermanX commented 2 months ago

How about creating a project via npm create slidev@latest, install @iconify-json/logos locally, and then run npm run export?

Mrbibi38 commented 2 months ago

Same issue... :/