The error message was displayed because the invisible condition is only
triggered when all the fields have been rendered and the javascript is
evaluated.
There is nothing I can do about that. Instead what I did was remove the
css box around the text so that if no text is present nothing is shown.
Added the error message as a field so that it only appears when the
attrs are evaluated.