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

Blink 0.12.6 breaks PlotlyJS #300

Closed
takbal opened this issue Feb 18, 2023 · 6 comments · Fixed by #310
Closed

Blink 0.12.6 breaks PlotlyJS #300

takbal opened this issue Feb 18, 2023 · 6 comments · Fixed by #310
Labels

Comments

@takbal
Copy link

takbal commented Feb 18, 2023

Clean install containing only PlotlyJS breaks on the second plot() call:

% julia --startup-file=no --banner=no
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 16 × AMD Ryzen 7 1700 Eight-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver1)
  Threads: 1 on 16 virtual cores

(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
  [f0f68f2c] PlotlyJS v0.18.10

julia> using Pkg, PlotlyJS

julia> [ (p.name, p.version) for (_,p) in Pkg.dependencies() if p.name in ["Blink","WebIO","PlotlyJS"] ]
3-element Vector{Tuple{String, VersionNumber}}:
 ("PlotlyJS", v"0.18.10")
 ("Blink", v"0.12.6")
 ("WebIO", v"0.8.20")

julia> plot([1])
[ Info: Listening on: 127.0.0.1:7323, thread id: 1

julia> plot([1])
┌ Error: An error occurred while trying to initialize a Blink window!
│   exception =
│    Javascript error   ReferenceError: webio is not defined
│    Stacktrace:
│     [1] js(o::Blink.Page, js::WebIO.JSString; callback::Bool)
│       @ Blink ~/.julia/packages/Blink/SMxOp/src/rpc/rpc.jl:53
│     [2] js(win::Blink.AtomShell.Window, s::WebIO.JSString; callback::Bool)
│       @ Blink.AtomShell ~/.julia/packages/Blink/SMxOp/src/AtomShell/window.jl:263
│     [3] js(o::Blink.AtomShell.Window, j::Expr; callback::Bool)
│       @ Blink ~/.julia/packages/Blink/SMxOp/src/rpc/rpc.jl:61
│     [4] js
│       @ ~/.julia/packages/Blink/SMxOp/src/rpc/rpc.jl:61 [inlined]
│     [5] initwebio!(w::Blink.AtomShell.Window)
│       @ Blink.AtomShell ~/.julia/packages/Blink/SMxOp/src/AtomShell/webio.jl:17
│     [6] initwindow!(w::Blink.AtomShell.Window, callback_cond::Condition)
│       @ Blink.AtomShell ~/.julia/packages/Blink/SMxOp/src/AtomShell/window.jl:92
│     [7] (::Blink.AtomShell.var"#9#10"{Blink.AtomShell.Window, Condition})()
│       @ Blink.AtomShell ./task.jl:484
└ @ Blink.AtomShell ~/.julia/packages/Blink/SMxOp/src/AtomShell/window.jl:69

julia> 

The issue goes away with downgrading Blink:

(@v1.8) pkg> add [email protected]
    Updating registry at `~/.julia/registries/takbal`
    Updating git-repo `[email protected]:julia-registry.git`
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
    Updating `~/.julia/environments/v1.8/Project.toml`
⌃ [ad839575] + Blink v0.12.5
    Updating `~/.julia/environments/v1.8/Manifest.toml`
  [9e28174c] + BinDeps v1.0.2
  [d1d4a3ce] - BitFlags v0.1.7
⌃ [ad839575] ↓ Blink v0.12.6 ⇒ v0.12.5
  [944b1d66] - CodecZlib v0.7.1
⌅ [cd3eb016] ↓ HTTP v1.7.4 ⇒ v0.9.17
  [e6f89c97] - LoggingExtras v1.0.0
⌅ [a975b10e] ↓ Mux v1.0.1 ⇒ v0.7.6
  [4d8831e6] - OpenSSL v1.3.3
  [777ac1f9] - SimpleBufferStream v1.1.0
  [3bb67fe8] - TranscodingStreams v0.9.11
  [30578b45] + URIParser v0.4.1
⌃ [104b5d7c] ↓ WebSockets v1.6.0 ⇒ v1.5.9
  [458c3c95] - OpenSSL_jll v1.1.20+0
        Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m`

Then after restart:

% julia --startup-file=no --banner=no
(@v1.8) pkg> st
Status `~/.julia/environments/v1.8/Project.toml`
⌃ [ad839575] Blink v0.12.5
  [f0f68f2c] PlotlyJS v0.18.10
Info Packages marked with ⌃ have new versions available and may be upgradable.

julia> using Pkg, PlotlyJS
[ Info: Precompiling PlotlyJS [f0f68f2c-4968-5e81-91da-67840de0976a]

julia> [ (p.name, p.version) for (_,p) in Pkg.dependencies() if p.name in ["Blink","WebIO","PlotlyJS"] ]
3-element Vector{Tuple{String, VersionNumber}}:
 ("PlotlyJS", v"0.18.10")
 ("Blink", v"0.12.5")
 ("WebIO", v"0.8.20")

julia> plot([1])

julia> plot([1])

julia> plot([1])

julia> plot([1])

julia> plot([1])

julia> 

The issue persists with [email protected] as well and [email protected] is already older, so it appears that Blink introduced the problem.

People already shopping around with this issue in the other packages:

JuliaGizmos/WebIO.jl#505
JuliaPlots/PlotlyJS.jl#460

@takbal takbal changed the title Latest Blink release breaks PlotlyJS Blink 0.12.6 breaks PlotlyJS Feb 18, 2023
@pfitzseb
Copy link
Member

I can't repro this, unfortunately. Seems likely to be a race condition somewhere in the WebIO initialization code, but it's kinda tricky to debug without a reproducer.

@pfitzseb pfitzseb added the bug label Feb 20, 2023
@mzaffalon
Copy link

As reported by @takbal, this happens after a couple of plots to me as well on a Windows 10 machine with Julia 1.8.5.

@takbal
Copy link
Author

takbal commented Feb 20, 2023

@pfitzseb I can 100% reproduce this on the second plot. Maybe you have a hint what to log or print?

@rasmushenningsson
Copy link

Version 0.12.6 fails for me both with PlotlyJS as described above (both on linux and windows), but also when just loading a html file in a Blink Window.
0.12.5 works well.

@rasmushenningsson
Copy link

Any news on this?

@rasmushenningsson
Copy link

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants