Trouble finding the correct path to template in custom module and getting the "Unable to find the template" error I've created a custom module trying to implement new field types. I'm using How to create custom field type in Craft 3 and https://github.com/mmikkel/IncognitoField-Craft3
as reference on how to structure the module. 

However, with a barebones version, I cannot seem to get the correct path to my templates. My module structure has the templates at:

SalesteamModule/src/templates/_components/fields/_input.twig


And the main function is:


public function getInputHtml($value, ElementInterface $element = null): string
    {
        // Get our id and namespace
        $id = Craft::$app-&gt;getView()-&gt;formatInputId($this-&gt;handle);
        $namespacedId = Craft::$app-&gt;getView()-&gt;namespaceInputId($id);

        // Render the input template
        return Craft::$app-&gt;getView()-&gt;renderTemplate(
            'salesteam-module/_components/fields/_input',
            [
                'name' =&gt; $this-&gt;handle,
                'value' =&gt; $value,
                'field' =&gt; $this,
                'id' =&gt; $id,
                'namespacedId' =&gt; $namespacedId,
            ]
        );
    }


App.php

return [

    // All environments
    '*'       =&gt; [
        'modules'   =&gt; [
            'site-module' =&gt; [
                'class' =&gt; \modules\sitemodule\SiteModule::class,
            ],
            'salesteam-module' =&gt; [
                'class' =&gt; \modules\salesteammodule\SalesteamModule::class,
            ],
        ],
        'bootstrap' =&gt; ['site-module', 'salesteam-module'],
    ],

    // Live (production) environment
    'live'    =&gt; [
    ],

    // Staging (pre-production) environment
    'staging' =&gt; [
    ],

    // Local (development) environment
    'local'   =&gt; [
    ],
];


The module is registered as "salesteam-module" in the app config, so I don't think it's a module id thing. And the path I copied the structure of the Incognito plugin I posted above. Although that repo is a plugin, not a module if that makes any difference.

Not sure where to go from here since I've tried a whole slew of different path combinations.

Thanks
If this is a module and not a plugin, you might need to declare your base template directory in the Module's __construct using:

Event::on(View::class, View::EVENT_REGISTER_CP_TEMPLATE_ROOTS, function (craft\events\RegisterTemplateRootsEvent $e) {
    if (is_dir($baseDir = $this-&gt;getBasePath() . DIRECTORY_SEPARATOR . 'templates')) {
        $e-&gt;roots[$this-&gt;id] = $baseDir;
    }
});


See Andrews's article on the subject.