bauglir / Kroki.jl

Supports creating a variety of diagrams through the https://kroki.io service.

Home Page:https://bauglir.github.io/Kroki.jl/stable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MethodError: transcode(::Type{CodecZlib.ZlibCompressor}, ::String) is ambiguous

baggepinnen opened this issue · comments

After updating packages, this diagram errors

Kroki.Diagram(:Mermaid, "
graph LR
    MTK[ModelingToolkit<br>model] -->|Linearize| CS[ControlSystems<br>model]
    CS --> D{Control<br>design}
    D --> V1{Linear<br>Verification}
    V1 -->|ODESys| MTK2[ModelingToolkit<br>model]
    MTK2 --> S{Nonlinear<br>simulation}
    V1 -->|Refine| D
    S --> V2{Nonlinear<br>Verification}
    V2 -->|Refine| D
    V2 --> C-code
    classDef cMTK fill:#f66,stroke:#333;
    classDef cCS fill:#66f,stroke:#333;
    class MTK,MTK2,S,V2 cMTK;
    class CS,D,V1 cCS;
")
Failed to show value:

MethodError: transcode(::Type{CodecZlib.ZlibCompressor}, ::String) is ambiguous. Candidates:

transcode(T, src::String) in Base at c.jl:291

transcode(::Type{C}, args...) where C<:TranscodingStreams.Codec in TranscodingStreams at /home/jrun/data/.julia/packages/TranscodingStreams/5yQuA/src/transcode.jl:33

Possible fix, define

transcode(::Type{C}, ::String) where C<:TranscodingStreams.Codec

var"#render#4"(::Dict{String, String}, ::typeof(Kroki.render), ::Kroki.Diagram, ::String)@Kroki.jl:172
render@Kroki.jl:149[inlined]
show(::IOContext{IOBuffer}, ::MIME{Symbol("image/svg+xml")}, ::Kroki.Diagram)@Kroki.jl:351
show_richest(::IOContext{IOBuffer}, ::Any)@PlutoRunner.jl:1170
show_richest_withreturned(::IOContext{Base.DevNull}, ::Any)@PlutoRunner.jl:1095
format_output_default(::Any, ::Any)@PlutoRunner.jl:995
var"#format_output#60"(::IOContext{Base.DevNull}, ::typeof(Main.PlutoRunner.format_output), ::Any)@PlutoRunner.jl:1012
formatted_result_of(::Base.UUID, ::Base.UUID, ::Bool, ::Vector{String}, ::Nothing, ::Module)@PlutoRunner.jl:905
top-level scope@WorkspaceManager.jl:476

JuliaSimControl docs build also errors with the same message
https://github.com/JuliaComputing/JuliaSimControl.jl/actions/runs/4681764684/jobs/8294761719

Thanks for reporting! This is the equivalent of JuliaIO/TranscodingStreams.jl#139 and appears to be caused by changes made to the signature for transcode in JuliaIO/TranscodingStreams.jl#136.

I could try to work around this here, but this seems like an issue that should be fixed in TranscodingStreams instead. If you need a quick fix, you can pin TranscodingStreams to v0.9.11 which appears to be working from some quick tests.

This has been resolved through JuliaIO/TranscodingStreams.jl#141 which has been released in TranscodingStreams@0.9.13. This should now be working again as expected.