Vaadin ComboBox Error

I am encountering this error as a result of a comboBox in my form. The error is (TypeError): cannot read property ‘enableclientvalidation’ of undefined. The source code for the combobox is:

ComboBox combo=new ComboBox<>();
combo.setRequired(true);
combo.setRequiredIndicatorVisible(true);
combo.setItems(“Item 1”,“Item 2”,“Item 3”);
combo.setPlaceholder(“Select an item of your choice”);

In PWA the error is (TypeError) : $0.$connector is undefined

How do I get rid of this error?

It seems that it could be related to [this issue]
(https://github.com/vaadin/vaadin-combo-box-flow/issues/235).

One workaround that you could try is this:

ComboBox combo = new ComboBox<>();
combo.addAttachListener(ev->{
	combo.setRequired(true);
	combo.setRequiredIndicatorVisible(true);
});
combo.setItems("Item 1", "Item 2", "Item 3");
combo.setPlaceholder("Select an item of your choice");

Tell me if that works.

Regards.

Worked like a charm.How can I give this like a million star rating?