diff -u b/recaptcha.module b/recaptcha.module --- b/recaptcha.module +++ b/recaptcha.module @@ -87,6 +87,7 @@ 'data-size' => $config->get('widget.size'), 'data-tabindex' => $config->get('widget.tabindex'), ]; + $captcha['form']['#attached']['library'][] = 'recaptcha/recaptcha'; // Set the callback for invisible captcha. if ('invisible' === $config->get('widget.size')) { @@ -121,9 +122,6 @@ 'recaptcha_api', ], ], - 'library' => [ - 'recaptcha/recaptcha', - ], ], ]; }