Closed yojeek closed 8 months ago
I've encountered the same issue. As shown in the screenshot below, I created a Subgraph, and when I clicked the Save Subgraph button, an error was logged in the console
This is a pretty big issue - both in terms of severity, as well as complexity unfortunately. In essence, the changes introduced by #328 added a conflicting system for how to handle inputs/outputs for graphs. Previously, I had separate inputs
and outputs
properties for graphs and graph templates, which acted as "virtual" input and output nodes. Now, the nodes are actually part of the graph, which is a nice change IMO. However, it creates a redundancy between the inputs
/outputs
properties and the subgraph input/output nodes. During calculations, the input values for the node interfaces coming from outside the graph are directly applied based on the inputs
graph property. But since the subgraph input nodes are treated as normal nodes now, the engine expects them to have output values, which they don't have at the moment.
Ideally, I would just let the subgraph input nodes emit the outside value as their output value but I had a few issues when implementing it. In addition, I'd like to consolidate the input
/output
properties and input/output subgraph nodes, which is hard to do without creating breaking changes. I am working on it, but due to the complexity of the issue and the limited time I have available at the moment, it might still take a few more weeks until I am able to push a fix.
To reproduce just create subgraph.
Looks like regression after https://github.com/newcat/baklavajs/commit/15a45c4a8eb35fc0a98248ce4c7ae0c066369df5
But probably the core reason is an attempt to recalculate subgraph while it's being destroyed https://github.com/newcat/baklavajs/blob/master/packages/core/src/graphNode.ts#L130 :