asciidoctor / asciidoctor-intellij-plugin

AsciiDoc plugin for products on the IntelliJ platform (IDEA, RubyMine, etc)
https://intellij-asciidoc-plugin.ahus1.de/
Apache License 2.0
354 stars 145 forks source link

Kroki preview broke since most recent upgrade to 0.41.11 #1585

Closed kistlin closed 6 months ago

kistlin commented 6 months ago

Observed vs. expected behavior

unable to render AsciiDoc document

org.asciidoctor.jruby.internal.AsciidoctorCoreException: org.jruby.exceptions.NameError: (NameError) asciidoctor: FAILED: /home/user/doc.adoc: Failed to load AsciiDoc document - uninitialized constant AsciidoctorExtensions::KrokiDiagram::Base64

org.jruby.exceptions.NameError: (NameError) asciidoctor: FAILED: /home/user/doc.adoc: Failed to load AsciiDoc document - uninitialized constant AsciidoctorExtensions::KrokiDiagram::Base64

org.jruby.exceptions.NameError: (NameError) uninitialized constant AsciidoctorExtensions::KrokiDiagram::Base64

(the full exception stack trace is available in the IDE's log file. Visit menu item 'Help | Show Log in Explorer' to see the log)

Expected behavior is that the preview is rendered.

Steps to reproduce

Setup this docker compose file to run a local instance. https://github.com/asciidoctor/asciidoctor-intellij-plugin/issues/1361#issuecomment-1564984564

Configure the plugin to use the local Kroki instance on http://localhost:8000/. And use the plugin to try and render a mermaid diagram. (same with PlantUML)

Setup a *.adoc with content

[mermaid]
....
sequenceDiagram
    participant Alice
    participant Bob
    Alice->>Bob: Hello Bob, how are you?
    Bob-->>Alice: Great!
....

This used to render, but now fails with the mentioned error.

Environment

Plugin Version: 0.41.11 IntelliJ Details: 2023.3.4

A downgrade to 0.41.9 makes it work again.

ahus1 commented 6 months ago

Thank you for reporting this, and sorry this causes you trouble. I'll be porting change https://github.com/asciidoctor/asciidoctor-kroki/issues/444 to the AsciiDoc plugin.

BTW, the AsciiDoc plugin for IntelliJ as an embedded Mermaid support which is experimental, still you might want to give it a try. You enable it in the same settings menu where you enabled Kroki.

ahus1 commented 6 months ago

This will be fixed in the next upcoming release. I'll update the issue once a pre-release is available. Thank you for providing a nice reproducer for the problem.

ahus1 commented 6 months ago

There is now release 0.41.12 which includes this change.

I published just now to the JetBrains marketplace. It should be available via the automatic update mechanism later today.

The release of the plugin is available from GitHub releases for manual installation in the meantime.

kistlin commented 6 months ago

Thank you for the quick fix. It works.