Closed ichko closed 3 years ago
I got the same error, but found a solution. First, steps to reproduce for devs:
Fix: in NumControl change the constructor:
class NumControl extends Rete.Control {
constructor(emitter, key, readonly) {
super(key + "_control"); // added a different key here
this.component = VueNumControl;
this.props = { emitter, ikey: key, readonly };
}
and change the AddComponent accordingly.
class AddComponent extends Rete.Component {
[...]
builder(node) {
// Only change this line
var out = new Rete.Output('onum', "Number", numSocket); // change the outputs name to onum (because num is already an input)
}
[...]
worker(node, inputs, outputs) {
var n1 = inputs['num'].length?inputs['num'][0] : 0;
var n2 = inputs['num2'].length?inputs['num2'][0] : 0;
var sum = n1 + n2;
this.editor.nodes.find(n => n.id == node.id).controls.get('preview_control').setValue(sum); // change to preview_control here
outputs['onum'] = sum; // set the new output name
}
}
I kind of already found another library for node editing, but I might try it out. Thanks! It is interesting why is it not erroring out in the codepen example?
[Vue warn]: Duplicate keys detected: 'num'. This may cause an update error
. I could not find open or closed issue with this here. Can you help me?