Why I'm receiving error message when adding a widget to the form?