asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
322 stars 97 forks source link

Size issue with rendering embedded PlantUML diagrams? #386

Open nullptr1108 opened 3 years ago

nullptr1108 commented 3 years ago

When trying to embed PUML diagrams there seems to be some upper size limit or URL timeout that is causing an error condition

Configuration Settings

The only custom setting is

The following assignment works and correctly renders the PUML in the Preview pane plantuml::./working.puml[]

The following assignment does not work and will only render the broken image icon in the preview plantuml::./broken.puml[]

Both of the puml files have been attached along with a sample adoc file that shows the behavior. Both are correctly formed PUML diagrams that I am able to render in VS Code using the plugin listed above. The only thing that materially differs in the diagrams is that the 'broken' one has more detail and renders to a slightly larger size.

Thanks in advance Example.zip

ptensschi commented 3 years ago

Unfortunately you did not post your error message, but I also had an issue with large diagrams and asciidoctor-kroki. For me the issue was a buffer that was too small in asciidoctor-kroki's dependency unxhr. I fixed this locally by increasing the maxBuffer in XMLHttpRequest.js:

--request-options=${JSON.stringify(JSON.stringify(options))`, { stdio: ['pipe', 'pipe', 'pipe'], input: data, maxBuffer: 4*1024*1024 })
ggrossetie commented 3 years ago

@ptensschi Indeed!

In the latest version of Asciidoctor Kroki, the default value of maxBuffer is now 100 MB (and it's also possible to configure the value using the environment variable UNXHR_MAX_BUFFER): https://github.com/Mogztter/asciidoctor-kroki/releases/tag/v0.12.0

Having said that there's another limit when you are using GET requests: https://docs.kroki.io/kroki/setup/configuration/#_max_uri_length

For reference, the max URI length on kroki.io is 4096. In the upcoming version of Kroki, you will be able to configure this value (if you are running your own instance)