Ajax validation only works when I am logged in as an administrator I have created a custom contact form and I have set up an ajax inline validation. My form works very well. But Ajax validation only works when I am connected. When I am not logged in as an administrator, ajax validation does not work.

Also I created a block to display the form in my footer. This form does not appear when I am logged in as an administrator. When I am connected I have access to the form only through the path I defined in module.routing.yml. And when it appears (so when I'm not logged in and I'm just a visitor), Ajax doesn't work on this block form either.

Does anyone have any idea what could cause this?
Please help me.
These kind of errors often happen when you have not attached the proper library to your form. So one thing to check is if you have $form['#attached']['library'][] = 'core/drupal.dialog.ajax'; in your form's buildForm().