JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
520 stars 75 forks source link

Interact `button()` Broken #365

Open duncanam opened 4 years ago

duncanam commented 4 years ago

Hello,

I've been trying to run:

using Interact
ui = button()

but I am encountering:

ERROR: Invalid dependency (must be a url, file, or AssetRegistry path): /home/duncan/.julia/packages/Knockout/IP1uR/src/../assets/knockout.js
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] path2url(::SubString{String}) at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:209
 [3] dep2url(::String) at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:226
 [4] lower(::Asset) at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:51
 [5] lowerassets(::Asset) at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:118
 [6] iterate at ./generator.jl:47 [inlined]
 [7] _collect(::Array{Any,1}, ::Base.Generator{Array{Any,1},typeof(WebIO.lowerassets)}, ::Base.EltypeUnknown, ::Base.HasShape{1}) at ./array.jl:678
 [8] collect_similar(::Array{Any,1}, ::Base.Generator{Array{Any,1},typeof(WebIO.lowerassets)}) at ./array.jl:607
 [9] map(::Function, ::Array{Any,1}) at ./abstractarray.jl:2072
 [10] lowerassets(::Async) at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:119
 [11] (::WebIO.var"#23#24"{Async})(::Base.GenericIOBuffer{Array{UInt8,1}}) at /home/duncan/.julia/packages/WebIO/2mZPb/src/syntax.jl:221
 [12] sprint(::Function; context::Nothing, sizehint::Int64) at ./strings/io.jl:105
 [13] sprint at ./strings/io.jl:101 [inlined]
 [14] tojs at /home/duncan/.julia/packages/WebIO/2mZPb/src/asset.jl:112 [inlined]
 [15] (::WebIO.var"#42#43"{Scope,WebIO.JSString})(::Base.GenericIOBuffer{Array{UInt8,1}}) at /home/duncan/.julia/packages/WebIO/2mZPb/src/syntax.jl:221
 [16] sprint(::Function; context::Nothing, sizehint::Int64) at ./strings/io.jl:105
 [17] sprint at ./strings/io.jl:101 [inlined]
 [18] onimport at /home/duncan/.julia/packages/WebIO/2mZPb/src/scope.jl:313 [inlined]
 [19] knockout(::Node{WebIO.DOM}, ::Array{Pair{String,Observable},1}, ::WebIO.JSString; computed::Array{Any,1}, methods::Array{Any,1}) at /home/duncan/.julia/packages/Knockout/IP1uR/src/Knockout.jl:124
 [20] knockout at /home/duncan/.julia/packages/Knockout/IP1uR/src/Knockout.jl:27 [inlined] (repeats 2 times)
 [21] button(::Interact.Bulma; label::String, value::Int64, style::Dict{String,Any}, className::String, attributes::Dict{Any,Any}, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/duncan/.julia/packages/InteractBase/NMcus/src/input.jl:298
 [22] button(::Interact.Bulma) at /home/duncan/.julia/packages/InteractBase/NMcus/src/input.jl:288
 [23] button(; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/duncan/.julia/packages/Widgets/451tD/src/defaults.jl:10
 [24] button() at /home/duncan/.julia/packages/Widgets/451tD/src/defaults.jl:8
 [25] top-level scope at REPL[4]:1

I'm not seeing anything over at Knockout.jl in terms of issues, so is this a problem with my install? I've deleted Julia entirely and reinstalled it from scratch to start clean and make sure it was not an issue there.

twavv commented 4 years ago

Thanks for this issue. It's come up a number of times recently. I'm not able to reproduce it, though.

julia> using Interact
[ Info: Precompiling Interact [c601a237-2ae4-5e1e-952c-7a85b0c7eef1]

julia> ui = button()
(div { className="field interact-widget" }
    (button { attributes=Dict{Any,Any}("data-bind" => "click: function (){this.clicks(this.clicks()+1)}, css: {'is-loading' : loading}") className="is-medium button is-primary" style=Dict{String,Any}() }
    "Press me!"))

Can you include include the output of Pkg.status() as well as any other information about the environment you're running in (e.g. is it JuliaPro, output of versioninfo()).

duncanam commented 4 years ago

Sure, Pkg.status() gives me:

julia> Pkg.status()
Status `~/.julia/environments/v1.4/Project.toml`
  [ad839575] Blink v0.12.3
  [336ed68f] CSV v0.6.1
  [159f3aea] Cairo v1.0.3
  [8f4d0f93] Conda v1.4.1
  [a93c6f00] DataFrames v0.20.2
  [864edb3b] DataStructures v0.17.15
  [0c46a032] DifferentialEquations v6.13.0
  [c87230d0] FFMPEG v0.3.0
  [60bf3e95] GLPK v0.12.1
  [28b8d3ca] GR v0.48.0
  [4c0ca9eb] Gtk v1.1.3
  [7073ff75] IJulia v1.21.2
  [c601a237] Interact v0.10.3
  [b6b21f68] Ipopt v0.6.1
  [7e6089bf] JANAF v0.1.0 #master (https://github.com/duncanam/JANAF.jl.git)
  [4076af6c] JuMP v0.21.2
  [b964fa9f] LaTeXStrings v1.1.0
  [ee78f7c6] Makie v0.10.0
  [5a521ce4] MakieLayout v0.9.5
  [a975b10e] Mux v0.7.1
  [a4795742] NLPModels v0.12.3
  [f4238b75] NLPModelsIpopt v0.3.3
  [2774e3e8] NLsolve v4.3.0
  [47be7bcc] ORCA v0.3.1
  [9b87118b] PackageCompiler v1.1.1
  [f0f68f2c] PlotlyJS v0.13.1
  [91a5bcdd] Plots v1.0.14
  [438e738f] PyCall v1.91.4
  [f2b01f46] Roots v1.0.1
  [af85af4c] RowEchelon v0.1.1
  [0f1e0344] WebIO v0.8.11
  [ade2ca70] Dates 
  [8dfed614] Test 

and versioninfo():

julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

I primarily write in VSCode, but I have tried these commands in terminal REPL as well as Jupyter Lab (I'm aware that WebIO is broken with Lab V2.0 right now, but I was hoping to at least get something up and running with Mux, for example).