Open ClaudMor opened 4 years ago
I'd like to +1 this- it occurs when I'm trying to use any Interact widget, across both Blink and Mux.
Is there any solution for this already? I also find this issue when I try to use any Interact widget both in Juno-Atom and IJulia notebook.
It's possible that Knockout.jl failed to build (Knockout downloads the JS files at build time) and thus the asset that it's trying to register doesn't exist.
Try running
using Julia
Pkg.build("Knockout")
Thanks a lot! I could solve the problem! Trying to build Knockout gave me a different error that pointed me to the actual problem: OhMyREPL
For some reason OhMyREPL wasn't allowing WebIO to be built correctly. After I commented out the line using OhMyREPL
from my startup.jl file and restarted the notebook kernel, it worked!
I did it and another error appeard, any idea of how to solve it?
Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Scope(Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :label), Any["a"], Dict{Symbol, Any}(:className => "interact ", :style => Dict{Any, Any}(:padding => "5px 10px 0px 10px")))], Dict{Symbol, Any}(:className => "interact-flex-row-left")), Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :input), Any[], Dict{Symbol, Any}(:max => 10, :min => 1, :attributes => Dict{Any, Any}(:type => "range", Symbol("data-bind") => "numericValue: index, valueUpdate: 'input', event: {change: function (){this.changes(this.changes()+1)}}", "orient" => "horizontal"), :step => 1, :className => "slider slider is-fullwidth", :style => Dict{Any, Any}()))], Dict{Symbol, Any}(:className => "interact-flex-row-center")), Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Node{WebIO.DOM}(WebIO.DOM(:html, :p), Any[], Dict{Symbol, Any}(:attributes => Dict("data-bind" => "text: formatted_val")))], Dict{Symbol, Any}(:className => "interact-flex-row-right"))], Dict{Symbol, Any}(:className => "interact-flex-row interact-widget")), Dict{String, Tuple{Observables.AbstractObservable, Union{Nothing, Bool}}}("changes" => (Observable{Int64} with 1 listeners. Value: 0, nothing), "index" => (Observable{Any} with 2 listeners. Value: 5, nothing)), Set{String}(), nothing, Asset[Asset("js", "knockout", "C:\Users\User\.julia\packages\Knockout\3gjS1\src\..\assets\knockout.js"), Asset("js", "knockout_punches", "C:\Users\User\.julia\packages\Knockout\3gjS1\src\..\assets\knockout_punches.js"), Asset("js", nothing, "C:\Users\User\.julia\packages\InteractBase\o1I6G\src\..\assets\all.js"), Asset("css", nothing, "C:\Users\User\.julia\packages\InteractBase\o1I6G\src\..\assets\style.css"), Asset("css", nothing, "C:\Users\User\.julia\packages\Interact\pVyN2\src\..\assets\bulma_confined.min.css")], Dict{Any, Any}("changes" => Any[WebIO.JSString("(function (val){return (val!=this.model[\"changes\"]()) ? (this.valueFromJulia[\"changes\"]=true, this.model\"changes\") : undefined})")], "index" => Any[WebIO.JSString("(function (val){return (val!=this.model[\"index\"]()) ? (this.valueFromJulia[\"index\"]=true, this.model\"index\") : undefined})")]), WebIO.ConnectionPool(Channel{Any}(32), Set{AbstractConnection}(), Condition(Base.InvasiveLinkedList{Task}(Task (runnable) @0x000000004f77c3f0, Task (runnable) @0x000000004f77c3f0), Base.AlwaysLockedST(1))), WebIO.JSString[WebIO.JSString("function () {\n var handler = (function (ko, koPunches) {\n ko.punches.enableAll();\n ko.bindingHandlers.numericValue = {\n init: function(element, valueAccessor, allBindings, data, context) {\n var stringified = ko.observable(ko.unwrap(valueAccessor()));\n stringified.subscribe(function(value) {\n var val = parseFloat(value);\n if (!isNaN(val)) {\n valueAccessor()(val);\n }\n });\n valueAccessor().subscribe(function(value) {\n var str = JSON.stringify(value);\n if ((str == \"0\") && ([\"-0\", \"-0.\"].indexOf(stringified()) >= 0))\n return;\n if ([\"null\", \"\"].indexOf(str) >= 0)\n return;\n stringified(str);\n });\n ko.applyBindingsToNode(\n element,\n {\n value: stringified,\n valueUpdate: allBindings.get('valueUpdate'),\n },\n context,\n );\n }\n };\n var json_data = {\"formatted_vals\":[\"0.1\",\"0.144444\",\"0.188889\",\"0.233333\",\"0.277778\",\"0.322222\",\"0.366667\",\"0.411111\",\"0.455556\",\"0.5\"],\"changes\":WebIO.getval({\"name\":\"changes\",\"scope\":\"15413358209832842711\",\"id\":\"12741283866794304884\",\"type\":\"observable\"}),\"index\":WebIO.getval({\"name\":\"index\",\"scope\":\"15413358209832842711\",\"id\":\"6037025313322159793\",\"type\":\"observable\"})};\n var self = this;\n function AppViewModel() {\n for (var key in json_data) {\n var el = json_data[key];\n this[key] = Array.isArray(el) ? ko.observableArray(el) : ko.observable(el);\n }\n \n [this[\"formatted_val\"]=ko.computed( function(){\n return this.formatted_vals()[parseInt(this.index())-(1)];\n }\n,this)]\n [this[\"changes\"].subscribe((function (val){!(this.valueFromJulia[\"changes\"]) ? (WebIO.setval({\"name\":\"changes\",\"scope\":\"15413358209832842711\",\"id\":\"12741283866794304884\",\"type\":\"observable\"},val)) : undefined; return this.valueFromJulia[\"changes\"]=false}),self),this[\"index\"].subscribe((function (val){!(this.valueFromJulia[\"index\"]) ? (WebIO.setval({\"name\":\"index\",\"scope\":\"15413358209832842711\",\"id\":\"6037025313322159793\",\"type\":\"observable\"},val)) : undefined; return this.valueFromJulia[\"index\"]=false}),self)]\n \n }\n self.model = new AppViewModel();\n self.valueFromJulia = {};\n for (var key in json_data) {\n self.valueFromJulia[key] = false;\n }\n ko.applyBindings(self.model, self.dom);\n}\n);\n (WebIO.importBlock({\"data\":[{\"name\":\"knockout\",\"type\":\"js\",\"url\":\"/assetserver/c2d59be8b1b2f7d7247a261dbf6ef29f39f8b21e-knockout.js\"},{\"name\":\"knockout_punches\",\"type\":\"js\",\"url\":\"/assetserver/eb25b961942fa6a3b69e5d340ffc53183ea9189f-knockout_punches.js\"}],\"type\":\"async_block\"})).then((imports) => handler.apply(this, imports));\n}\n")])], Dict{Symbol, Any}(:className => "field interact-widget")), Observable{Node{WebIO.DOM}} with 0 listeners. Value: Node{WebIO.DOM}(WebIO.DOM(:html, :div), Any[Plot{Plots.PlotlyBackend() n=1}], Dict{Symbol, Any}(:className => "interact-flex-row interact-widget"))], Dict{Symbol, Any}())
I'm facing the same problem, is there a solution already?
I still have the problem which was first presented in this issue and then moved to WebIO. I hope this is right place to ask.
The bug
Context
EDIT: the issue exists (with the same error) both on Juno and on jupyter lab.
EDIT2: I looked in \userpath\.juliapro\JuliaPro_v1.4.1-1\packages\Knockout\IP1uR\src\ and there seems to be no ..\assets\knockout.js . There only is a Knockout.jl wich looks like this:
Thanks for your help