Skip to content

IJulia cannot serialize SyncPlot display data, causing Invalid Signature and blank output #526

Open

Description

@Avandar2024

Summary

Displaying a PlotlyJS.SyncPlot in a recent IJulia notebook produces no plot. The underlying error is:

ArgumentError: Cannot serialize Plot{...} to JSON

Because this exception occurs after IJulia starts sending an execute_result multipart ZMQ message, the visible server-side error is instead:

ValueError: Invalid Signature: b"error"

Minimal reproduction

using PlotlyJS
x = 0:0.01:1
y = sin.(x)
plot(x, y, label="y", linewidth=2)

The SyncPlot itself is constructed successfully, and its WebIO JSON and HTML representations can be generated with repr. The failure happens when IJulia serializes the dictionary returned by the PlotlyJS IJulia extension.

Root cause

ext/IJuliaExt.jl currently contains:

"application/vnd.plotly.v1+json" => JSON.lower(p)

For p::PlotlyJS.SyncPlot, JSON.lower(p) unwraps only one level and returns the internal PlotlyBase.Plot. Recent IJulia serializes the complete message with IJulia.JSONX, which cannot serialize that Plot object.

The full underlying stack trace ends in:

ArgumentError: Cannot serialize Plot{...} to JSON
  at IJulia.JSONX.write_json
  at IJulia.send_ipython
  at IJulia.execute_request

Verified workaround

Changing the Plotly MIME entry to fully lower the underlying plot resolves the failure:

"application/vnd.plotly.v1+json" => PlotlyJS.JSON.lower(p.plot)

With that change, the same reproduction returns an execute_result containing:

application/vnd.plotly.v1+json
text/html
text/plain

The WebIO-backed HTML representation remains present, and no invalid ZMQ signature is produced.

Environment

Julia 1.12.7
PlotlyJS 0.18.18
IJulia 1.34.4
WebIO 0.8.21
Jupyter Client 8.10.0
Jupyter Server 2.21.0
macOS arm64

I can prepare a PR with the one-line fix and a regression test if this approach is acceptable.

Activity

  1. empet commented on Oct 18, 2026

    @empet

    Why hasn't anyone replied to @Avandar2024? Who is supposed to approve the creation of a PR, now? It hasn't been possible to display a figure for quite some time now. I'm interested in 3d figures, who effectively block both PlotlyJS.plot and PlotlyBase.Plot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions