Add new comment

Thanks for your answer.

I don't know if it will help, but I tried to put this code into hook_form_alter

function filt_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form['field_type_de_raccordement_target_id']['#ajax'] = array(
        'callback' => '_update_composants_callback',
        'wrapper' => 'composants_wrapper'

      $form['field_composants_target_id']['#prefix'] = '<div id="composants_wrapper">';
  $form['field_composants_target_id']['#suffix'] = '</div>';


And not putting these lines into hook_form_views_exposed_form_alter

Now I don't have any AJAX errors.
But it's not populating the second select box correctly. So not working. But maybe it will give you an idea.