-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Error with diagramsnet, when using parameters #1602
Comments
I am trying to fix it on my own and tinker a little bit... I found out with some print statements in this file kroki/diagrams.net/src/index.js Line 25 in 2b20ac9
But the kroki server returns 400. So i am guessing, there is an error in the communication with between diagramsnet java component and diagramsnet javascript component. It seems to me as an easy fix, if i would know the whole system. But i do not know how to debug this websocket stuff. Maybe you can give me some hints. |
I believe that the root cause is: https://github.com/yuzutech/kroki/blob/main/diagrams.net/src/index.js#L17 The regular expression asserts that the URL must end with svg or png but when there's an option it will end with |
You can take a look at how we handle things on the Mermaid service: |
Copy the same workaround as in mermaid https://github.com/yuzutech/kroki/blob/main/mermaid/src/index.js#L28-L29
Hey, that was easy. I think this issue was there with mermaid, too. So i copied the workaround from there. In the local docker setup, it fixes the issue. |
* Fix #1602 Copy the same workaround as in mermaid https://github.com/yuzutech/kroki/blob/main/mermaid/src/index.js#L28-L29 * Add a testcase for diagramsnet which have a query parameter
Hey,
as i mentioned here, i got an error when using a parameter in addition with diagramsnet.
Example:

I created a diagram with diagrams.net online editor:
The following url (generated by https://kroki.io/#how)
is working as expected and returns
<svg xmlns="http://www.w3.org/2000/svg" style="left: 0px; top: 0px; width: 100%; height: 100%; display: block; min-width: 122px; min-height: 62px;"><g><g/><g><g transform="translate(0.5,0.5)" style="visibility: visible;"><rect x="1" y="1" width="120" height="60" fill="rgb(255, 255, 255)" stroke="rgb(0, 0, 0)" pointer-events="all"/></g><g style=""><g><foreignObject pointer-events="none" width="100%" height="100%" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 118px; height: 1px; padding-top: 31px; margin-left: 2px;"><div data-drawio-colors="color: rgb(0, 0, 0); " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(0, 0, 0); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">Hello World</div></div></div></foreignObject></g></g></g><g/><g/></g></svg>
But if i add a query-parameter to the same url:
it returns
Error 400; Internal server error
I would expect, that it ignores the parameter and returns the same data as before.
I hope, my example clarifies the error. Thank you for your support.
Heiss
The text was updated successfully, but these errors were encountered: