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

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

Closed
baggepinnen opened this issue Apr 13, 2023 · 2 comments

Comments

@baggepinnen
Copy link

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

@bauglir
Copy link
Owner

bauglir commented Apr 13, 2023

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.

@bauglir
Copy link
Owner

bauglir commented May 2, 2023

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.

@bauglir bauglir closed this as completed May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants