diff --git a/field_group.module b/field_group.module
index e85c489..ca5dd60 100644
--- a/field_group.module
+++ b/field_group.module
@@ -138,9 +138,26 @@ function field_group_form_entity_view_display_edit_form_alter(&$form, FormStateI
  * Implements hook_field_info_max_weight().
  */
 function field_group_field_info_max_weight($entity_type, $bundle, $context, $context_mode) {
+  // Prevent recursion.
+  // @see https://www.drupal.org/project/drupal/issues/2966137
+  static $recursion_tracker = [];
+
+  // Track the entity type.
+  $key = $entity_type . ':' . $bundle . ':' . $context . ':' . $context_mode;
+
+  // If entity type check was attempted but did not finish, do not continue.
+  if (isset($recursion_tracker[$key])) {
+    return NULL;
+  }
+
+  // Mark this as an attempt at entity type check.
+  $recursion_tracker[$key] = TRUE;
 
   $groups = field_group_info_groups($entity_type, $bundle, $context, $context_mode);
 
+  // Remove the indicator once the entity is successfully checked.
+  unset($recursion_tracker[$key]);
+
   $weights = array();
   foreach ($groups as $group) {
     $weights[] = $group->weight;
