JavaScript error with @PreserveOnRefresh

I am using Vaadin 14.0.0 and for me it is still not possible to annotate my MainView with @PreserveOnRefresh, because I get a javascript error saying Cannot read property 'undefined' of undefined when I refresh the page. After the page has been refreshed, the server sometimes throws strange errors that never happen otherwise, so it’s not just a js error that can be ignored.

When I was using rc versions of 14 I was told that ComboBoxes don’t work yet with PreserveOnRefresh but since then I only saw statements that PreserveOnRefresh is now finished and ready to use. I don’t know if it’s the ComboBoxes that cause the error or some other component. A screenshot of the complete error in the console can be found in the attachment preserveonrefresh_error.png

17813672.png

Hello Kaspar!

Would you be able to create a ticket about your problem at [Flow issues]
(https://github.com/vaadin/flow/issues).

If you are able to provide a code example or to create a minimal example project which can be used to replicate the problem, that would be fantastic. Barring that, all relevant information would be appreciate, such as which Components are used and how the malfunctioning view is constructed.