diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php
index dd054f2..b4e945e 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/field/formatter/EntityReferenceEntityFormatter.php
@@ -95,7 +95,7 @@ public function viewElements(EntityInterface $entity, $langcode, FieldInterface
       static $depth = 0;
       $depth++;
       if ($depth > 20) {
-        throw new RecursiveRenderingException(format_string('Recursive rendering detected when rendering entity @entity_type(@entity_id). Aborting rendering.', array('@entity_type' => $entity_type, '@entity_id' => $item->target_id)));
+        throw new RecursiveRenderingException(format_string('Recursive rendering detected when rendering entity @entity_type (@entity_id). Aborting rendering.', array('@entity_type' => $target_type, '@entity_id' => $item->target_id)));
       }
 
       if (!empty($item->target_id)) {
