I think broke my Plots ("Failed to precompile Plots")– how can I restore it?

I’ve been happily working in Pluto using the Plotly backend for a few days, but today after updating to Julia 1.7 I had some issue that I tried to solve by following some instruction somewhere which made me delete files from /private/var/folders/52/7c2g08dx6k1fjgr5f5c3h9mr0000gn/T/ (I’m on macOS).

Now none of my plots show up in Pluto anymore when I use the Plotly backend, they just stay white.

In the REPL when I do

using Plots
plotly()
plot([1,2,3], [1,4,9])

my browser opens file:///private/var/folders/52/7c2g08dx6k1fjgr5f5c3h9mr0000gn/T/jl_xq1C1t.html but everything just stays white and empty.

I tried reinstalling Julia by removing it from Applications and deleting /.julia/ from my user folder, I removed and reinstalled all packages including Plots and Plotly but nothing works.

Not sure what exactly I messed up. Can somebody help me out here? How do I get this working again?

I just tried to use it again with Julia 1.6 and got this:

Precompiling project...
  ✗ Plots
  109 dependencies successfully precompiled in 35 seconds (19 already precompiled)
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

julia> import Pkg

julia> Pkg.precompile()
Precompiling project...
  ✗ Plots
  0 dependencies successfully precompiled in 8 seconds (128 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]

Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to /Users/chrisoffner/.julia/compiled/v1.6/Plots/jl_sfSKUe.
ERROR: LoadError: LoadError: too many parameters for type
Stacktrace:
  [1] _precompile_()
    @ Plots ~/.julia/packages/Plots/AGxtZ/deps/SnoopCompile/precompile/precompile_Plots.jl:92
  [2] top-level scope
    @ ~/.julia/packages/Plots/AGxtZ/src/precompile_includer.jl:14
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:384
  [4] include(x::String)
    @ Plots ~/.julia/packages/Plots/AGxtZ/src/Plots.jl:1
  [5] top-level scope
    @ ~/.julia/packages/Plots/AGxtZ/src/Plots.jl:267
  [6] include
    @ ./Base.jl:384 [inlined]
  [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
    @ Base ./loading.jl:1235
  [8] top-level scope
    @ none:1
  [9] eval
    @ ./boot.jl:360 [inlined]
 [10] eval(x::Expr)
    @ Base.MainInclude ./client.jl:446
 [11] top-level scope
    @ none:1
in expression starting at /Users/chrisoffner/.julia/packages/Plots/AGxtZ/src/precompile_includer.jl:9
in expression starting at /Users/chrisoffner/.julia/packages/Plots/AGxtZ/src/Plots.jl:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:1265
 [3] precompile
   @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:921 [inlined]
 [4] #precompile#196
   @ /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919 [inlined]
 [5] precompile()
   @ Pkg.API /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:919
 [6] top-level scope
   @ REPL[5]:1

Never mind, turns out I didn’t break anything but instead it seems Plots v1.24.4 (released today) broke something. When I revert to using Plots v1.24.3 everything works as expected.

I had the same issue which was resolved by running
] build GR
] build Plots

2 Likes