Output node.type in page.html.twig gives "EntityReferenceFieldItemList cannot be printed" Not sure if this is a bug, but I wanted to add some debug into an HTML comment in my page.html.twig file. I added &lt;!-- type={{node.type}} --&gt; but I get:

Uncaught PHP Exception Exception: "Object of type Drupal\Core\Field\EntityReferenceFieldItemList cannot be printed." at /www/cn8/core/lib/Drupal/Core/Template/TwigExtension.php line 443


It took me a while to track down since I was sure this would work. Shouldn't EntityReferenceFieldItemList have a toString() function for this purpose?
node.type is a reference to the node type entity. You can get the id of the content type with target_id, as you have mentioned in the comment. For debugging this might be OK, but most times you want to get the label, which is nicely formatted and translatable:

{{ node.type.entity.label }}