Use custom content entity theme suggestions in own module? I have a custom content entity called 'offer'.
I've added template_preprocess_offer() and offer_theme() to the  offer.module file.
function offer_theme($existing, $type, $theme, $path) {
  return [
    'offer' =&gt; [
      'render element' =&gt; 'elements',
    ],
  ];
}

function template_preprocess_offer(array &amp;$variables) {
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}

In modules/custom/offer/templates/offer.twig.html, I successfully render the entity.
Next, I've added theme suggestions because I've added a view mode 'full' via the UI.
/**
 * Adds template possibility for view modes
 * Implements hook_provider_theme_suggestions_hook_alter
 */
function offer_theme_suggestions_offer_alter( array &amp;$suggestions, array $vars, $hook ) {
  if ( $offer = $vars['elements']['#offer'] ) {
    if (isset($vars['elements']['#view_mode'])) {
      $suggestions[] = 'offer__' . $vars['elements']['#view_mode'];
    }
  }
}

After clearing caches:
&lt;!-- THEME DEBUG --&gt; &lt;!-- THEME HOOK: 'offer' --&gt; &lt;!-- FILE NAME SUGGESTIONS: * offer--full.html.twig x offer.html.twig --&gt; &lt;!-- BEGIN OUTPUT from 'modules/custom/offer/templates/offer.html.twig' --&gt;

This only works if I place a offer--full.html.twig inside the theme's templates folder. It doesn't work in the custom module template folder. Inside modules/custom/offer/templates, the template file with the view mode won't get used. While the template suggestions suggests offer--full.html.twig, offer.html.twig is used instead.
Why does it happen? How can I solve it?
Edit: I'm on drupal 9. My custom entity has no bundles. I've made sure the id inside @ContentEntityType is &quot;offer&quot;.
To make a theme suggestion work in the module folder you need an additional theme hook:
function offer_theme($existing, $type, $theme, $path) {
  return [
    'offer' =&gt; [
      'render element' =&gt; 'elements',
    ],
    'offer__full' =&gt; [
      'base hook' =&gt; 'offer',
    ],
  ];
}