I receive the following message when I attempt to submit a form with use-ajax-submit class attached to the submit button:

An error occurred while attempting to process /my_form?_wrapper_format=drupal_ajax: ajax.$form.ajaxSubmit is not a function

Similar to this question, but for Drupal 8.

1 Answer 1


The following dependencies need to be added to the library attached to the form in order to use use-ajax-submit.


    - core/drupal.ajax
    - core/jquery.form

The library needs to be attached to the form:

$form['#attached']['library'][] = 'my_module/my_module.my_library';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.