Reload very often not working...

VERY often while editing the application I am currently working on the reloading does not work!

In the console I then always get:

Compiling...
Checking started in a separate process...
...
Compiled successfully.
----------------- Frontend compiled successfully. -----------------

but there seems no reload triggered in the browser.

When I then trigger some UI callback that adds a component to the existing tree I always get:

java.lang.IllegalStateException: Can't move a node from one state tree to another. If this is intentional, first remove the node from its current state tree by calling removeFromTree
	at com.vaadin.flow.internal.StateNode.doSetTree(StateNode.java:717)
	at com.vaadin.flow.internal.StateNode.lambda$setTree$3(StateNode.java:370)
	at com.vaadin.flow.internal.StateNode.visitNodeTree(StateNode.java:670)
	at com.vaadin.flow.internal.StateNode.setTree(StateNode.java:370)
	at com.vaadin.flow.internal.StateNode.setParent(StateNode.java:270)
	at com.vaadin.flow.internal.nodefeature.NodeFeature.attachPotentialChild(NodeFeature.java:78)
	at com.vaadin.flow.internal.nodefeature.StateNodeNodeList.add(StateNodeNodeList.java:53)
	at com.vaadin.flow.internal.nodefeature.ElementChildrenList.add(ElementChildrenList.java:42)
	at com.vaadin.flow.dom.impl.AbstractNodeStateProvider.insertChild(AbstractNodeStateProvider.java:102)
	at com.vaadin.flow.dom.Node.insertChild(Node.java:294)
	at com.vaadin.flow.dom.Node.appendChild(Node.java:141)
	at com.vaadin.flow.component.HasComponents.add(HasComponents.java:55)
	...

After that exception the application is always unusable and only produces popups like
“Assertion error: no child node found with id xyz”

The exception happens where my code - triggered by the callback - creates a new form and wants to add that to the display:
content.add(form);
The newly created “form” at this point is NOT part of another tree - it was just newly created and is now about to be hooked into the existing tree (“content” is a Div). I guess the content stems from the prior frontend compilation, the “form” from the newer.
It would be OK if this situation throws me back to reloading the UI in the browser, but having to kill and restart the application each time PLUS having to restart the UI is pretty tedious. Any ideas how I could improve that?

Hi,

when you refresh the app, a new UI with a new state tree is created. Somehow you are re-using the form component instance from the old UI in your application. Re-using typically happens if you store the component in a static variable or if you are using Spring Boot or CDI injection with the wrong scope. Without seeing the code, it is hard to guess what the cause is.

This has nothing to do with frontend compilation.