Creating a custom widgets doesn't work
As described in the documentation I created a custom widget. Unfortunately, it doesn't work anymore: I cannot open the section's tab. Also, the insert function of the widget isn't called. In version 17.11 it worked.
In the Firefox console I can see the following Javascript error in the obfuscated main-built.js
InvalidCharacterError: String contains an invalid character main-built.js:6
e http://localhost:8000/main-built.js:6:95016
m/this.__ast__< http://localhost:8000/main-built.js:6:104195
get http://localhost:8000/main-built.js:6:108627
g http://localhost:8000/main-built.js:6:97002
h http://localhost:8000/main-built.js:6:99081
g http://localhost:8000/main-built.js:6:97002
h http://localhost:8000/main-built.js:6:99081
g/< http://localhost:8000/main-built.js:6:95413
get http://localhost:8000/main-built.js:6:101287
get http://localhost:8000/main-built.js:6:108627
createUpdater http://localhost:8000/main-built.js:6:101458
g http://localhost:8000/main-built.js:6:95270
h http://localhost:8000/main-built.js:6:99081
g/< http://localhost:8000/main-built.js:6:95413
get http://localhost:8000/main-built.js:6:101287
get http://localhost:8000/main-built.js:6:108627
createUpdater http://localhost:8000/main-built.js:6:101458
g http://localhost:8000/main-built.js:6:95270
h http://localhost:8000/main-built.js:6:99081
g http://localhost:8000/main-built.js:6:97002
h http://localhost:8000/main-built.js:6:99081
g/< http://localhost:8000/main-built.js:6:95413
get http://localhost:8000/main-built.js:6:101287
get http://localhost:8000/main-built.js:6:108627
createUpdater http://localhost:8000/main-built.js:6:101458
g http://localhost:8000/main-built.js:6:95270
h http://localhost:8000/main-built.js:6:99081
renderEnter http://localhost:8000/main-built.js:6:101853
g/< http://localhost:8000/main-built.js:6:95440
get http://localhost:8000/main-built.js:6:101287
get http://localhost:8000/main-built.js:6:108627
update http://localhost:8000/main-built.js:6:105275
update http://localhost:8000/main-built.js:6:4554
scheduleRunLoop/this.reqid< http://localhost:8000/main-built.js:6:4350
Here is a MWE:
My node looks like this:
@marv.node(Section)
@marv.input('title', default='my title')
@marv.input('stream', default=marv.select(raw_messages, "/my/topic"))
def my_section(title, stream):
yield marv.set_header()
rosmsg = get_message_type(stream)() if stream.msg_type else None
while True:
msg = yield marv.pull(stream)
if msg is None:
break
assert stream.msg_type == "std_msgs/String"
rosmsg.deserialize(msg.data)
widgets = [{'custom': {'type': 'json-viewer', 'data': '{"test": "OK"}'}}]
yield marv.push({'title': title, 'widgets': widgets})
break
My whole custom.js
is as follows:
window.marv_extensions = {
widgets: {
"json-viewer": [
function(a,b) { console.log("insert"); return {}; },
function(a) { console.log("remove"); }
]
}
};
The console.log
s are not executed since the JS errors happens before the logs.
Not sure, if it's relevant regarding this issue but I'll get the following JS error as soon as I visit the MARV website (even if I deactivate this node):
TypeError: d is undefined[Learn More] main-built.js:6:70915