PlotlyJS does not display plot and errors on `Pkg.test("PlotlyJS")`

This is the first time I use the package PlotlyJS. test PlotlyJS opens an empty window and outputs errors.

This is using Julia 1.5.4 on Windows 10.

(@v1.5) pkg> test PlotlyJS
    Testing PlotlyJS
Status `C:\Users\michele.zaffalon\AppData\Local\Temp\jl_xEWIyW\Project.toml`
  [ad839575] Blink v0.12.4
  [97c1335a] JSExpr v0.5.2
...
  [cf7118a7] UUIDs
  [4ec0a83e] Unicode
to_image: Error During Test at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\test\blink.jl:25
  Test threw exception
  Expression: (to_image(p))[1:21] == "data:image/png;base64"
  Could not get image
  Stacktrace:
   [1] error(::String) at .\error.jl:33
   [2] to_image(::PlotlyJS.SyncPlot; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\src\display.jl:267
   [3] to_image at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\src\display.jl:261 [inlined]
   [4] macro expansion at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\test\blink.jl:25 [inlined]
   [5] macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Test\src\Test.jl:1119 [inlined]
   [6] macro expansion at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\test\blink.jl:25 [inlined]
   [7] macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\Test\src\Test.jl:1119 [inlined]
   [8] top-level scope at C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\h3GxO\test\blink.jl:24
...
Test Summary:   | Pass  Fail  Error  Total
api methods     |    1     5     29     35
  to_image      |    1            5      6
  restyle       |                 4      4
  relayout      |                 1      1
  update        |                 5      5
  addtraces     |          2      3      5
  movetraces    |                 2      2
  deletetraces  |          2      1      3
  extendtraces  |                 2      2
  prependtraces |                 2      2
  react         |          1      4      5
ERROR: LoadError: LoadError: Some tests did not pass: 1 passed, 5 failed, 29 errored, 0 broken.

There is something wrong with the artifacts downloaded by the most recent release of PlotlyJS. For a temporary fix, feel free to try whether

julia>]add https://github.com/jonas-kr/PlotlyJS.jl

fixes the issue on your system.

1 Like

Thank you, the tests pass and a canvas open and displays the plot.

While adding the package from your repository, I got the following error, which didn’t prevent PlotlyJS to pass the tests.

(@v1.5) pkg> add https://github.com/jonas-kr/PlotlyJS.jl
    Cloning git-repo `https://github.com/jonas-kr/PlotlyJS.jl`
   Updating git-repo `https://github.com/jonas-kr/PlotlyJS.jl`
   Updating registry at `C:\Users\michele.zaffalon\.julia\registries\General`
   Updating git-repo `https://github.com/JuliaRegistries/General.git`
  Resolving package versions...
Downloading artifact: plotly-artifacts
Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."
At line:12 char:1
+ $webclient.DownloadFile("https://pkg.julialang.org/artifact/4fa45e1c1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException
Updating `C:\Users\michele.zaffalon\.julia\environments\v1.5\Project.toml`
  [f0f68f2c] ~ PlotlyJS v0.14.1 ⇒ v0.14.1 `https://github.com/jonas-kr/PlotlyJS.jl#master`
Updating `C:\Users\michele.zaffalon\.julia\environments\v1.5\Manifest.toml`
  [f0f68f2c] ~ PlotlyJS v0.14.1 ⇒ v0.14.1 `https://github.com/jonas-kr/PlotlyJS.jl#master`
   Building PlotlyJS → `C:\Users\michele.zaffalon\.julia\packages\PlotlyJS\OgA1J\deps\build.log`

Great! (Un)fortunately, it seems like the error you encountered is not related to PlotlyJS but arises since “plotly-artifacts” cannot be obtained from julia’s Pkg server. This issue should be fixed on 1.6 though: "The remote server returned an error: (404) Not Found."

1 Like

For what it’s worth, this is still a problem on 1.6 for me with PlotlyJS v0.14.1. (but it indeed works without a hitch with the fork linked above)