How to get tid on behalf of node id (nid) in Drupal 8?
A reference field doesn't have a property value. You can use entity to load the term or target_id to get the term id:

$tid = $node-&gt;field_tags-&gt;target_id;