Ok... so the issue I am seeing is related to the other issue I posted.. if I take this example and add a button and then add a node programmatically.. I get the exact same:
Error occurred:
undefined is not an object (evaluating 'e.width.toString')
So somehow adding a node programmatically with constraints enabled seems to be causing some internal issue.. can you just add a node programmatically and see what you get?
Also.. what would be nice is a simple example of adding two new nodes and then connecting them by finding the nodes by their Id.. that is what I do.. this way I can see your best practice to find node.. I have been using diagramInstance.getNodeObject since getObject seems to take a name but nodes don't have name.. so not sure the best way to find nodes to create the source and target.