Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In included example slides, slide 10 with Mermaid diagrams doesn't work: "An error occurred on this slide" #1409

Closed
janroden opened this issue Mar 11, 2024 · 2 comments · Fixed by #1559
Labels
bug Something isn't working global installation help wanted Extra attention is needed

Comments

@janroden
Copy link

Describe the bug

For the included example slides, slide 10 with the Mermaid diagrams doesn't show the content of the slide, but instead an error "An error occurred on this slide. Check the terminal for more information."

But the terminal doesn't show an error.

The other slides of the example slide deck work as expected.

Same behavior in both Firefox and Chrome.

When I remove the mermaid code blocks in the Markdown for slide 10, its content shows up in the browser and the error is gone.

To Reproduce

Steps to reproduce the behavior:

  1. Install Slidev globally with npm i -g @slidev/cli
  2. When prompted, choose to create example file and add the seriph theme
  3. Run npx slidev
  4. In browser, open http://localhost:3030/
  5. Observe how all slides show up as expected, except for slide 10 with the Mermaid diagrams, which shows the error instead of the slide content (see above)

Desktop:

  • OS: Linux (Kernel: 5.10.0-28-amd64 [5.10.209-2] x86_64 bits; Distro: MX-21.3_x64 Wildflower October 20 202; base: Debian GNU/Linux 11 (bullseye))
  • Browser: Firefox 123.0.1 (64-bit) (but also happens the same in Chrome 122.0.6261.111 (Official Build) (64-bit))
  • Slidev version: v0.48.1 (global)
@KermanX KermanX added bug Something isn't working global installation help wanted Extra attention is needed labels Mar 11, 2024
@KermanX
Copy link
Member

KermanX commented Mar 11, 2024

The error is caused by lz-string not getting optimized by Vite when Sldiev is installed globally.

It seems that the way Slidev includes dependency into optimizeDeps (for example, @slidev/cli > @slidev/client > lz-string) not working when installed globally:

image

@jxpeng98
Copy link

After update to 0.48.2, I still have the same issue with mermaid.

Here are the outputs:

Failed to resolve dependency: @slidev/cli > @slidev/client > @iconify-json/svg-spinners, present in 'optimizeDeps.include'
Failed to resolve dependency: @slidev/cli > @slidev/client > @shikijs/monaco, present in 'optimizeDeps.include'
Failed to resolve dependency: @slidev/cli > @slidev/client > @slidev/rough-notation, present in 'optimizeDeps.include'
Failed to resolve dependency: @slidev/cli > @slidev/client > @typescript/ata, present in 'optimizeDeps.include'
Failed to resolve dependency: @slidev/cli > @slidev/client > shiki-magic-move, present in 'optimizeDeps.include'
Failed to resolve dependency: @slidev/cli > @slidev/client > shiki-magic-move/vue, present in 'optimizeDeps.include'
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working global installation help wanted Extra attention is needed
Projects
None yet
3 participants