How to add auto create feature to custom taxonomy_term field while creating custom entity I created a custom module which has an custom entity.
I added base field term_id to it using below code

$fields['term_id'] = BaseFieldDefinition::create('entity_reference')
    -&gt;setLabel(t('Category'))
    -&gt;setDescription(t('Default Category.'))
    -&gt;setRevisionable(TRUE)
    -&gt;setSetting('target_type', 'taxonomy_term')
    -&gt;setSetting('handler', 'default:taxonomy_term')
    -&gt;setSetting('handler_settings', [
            'target_bundles' =&gt; ['question_category' =&gt; 'question_category']
        ]
    )
    -&gt;setTranslatable(TRUE)
    -&gt;setDisplayOptions('view', array(
        'label' =&gt; 'hidden',
        'type' =&gt; 'author',
        'weight' =&gt; 0,
    ))
    -&gt;setDisplayOptions('form', array(
        'type' =&gt; 'entity_reference_autocomplete',
        'weight' =&gt; 5,
        'settings' =&gt; array(
            'match_operator' =&gt; 'CONTAINS',
            'size' =&gt; '60',
            'autocomplete_type' =&gt; 'tags',
            'placeholder' =&gt; '',
        ),
    ))
    -&gt;setDisplayConfigurable('form', TRUE)
    -&gt;setDisplayConfigurable('view', TRUE);


I have a YAML file taxonomy.vocabulary.question_category.yml, 
which create question_category vocabulary, I can see it in admin too. 

But when I try to add a new text in it. I get an error
There are no entities matching ||new enitity title||

I want user to create terms and add it to question_category taxonomy.

Please suggest, what might be the error.

--

Thanks
I did it using below handler setting

setSetting('handler_settings', ['target_bundles' => ['question_sub_category' => 'question_sub_category'], 'auto_create' => TRUE])