Why do I get "Theme hook ... not found" after renaming? I have a module to create and handle surveys. I made a theme originally for it called "survey" and everything worked fine. I am now trying to rename the theme/template to "questionList", but am getting "Theme hook questionList not found" in the logs.

My working code with the theme name "survey" is shown below.

survey.module

 /**
 * Implements hook_theme().
 */
function survey_theme($existing, $type, $theme, $path)
{
    $variables = array(
        'survey' =&gt; array(
            'variables' =&gt; array(
                'questions'    =&gt; NULL,
            ),
        ),
    );
    return $variables;
}


RadioQuestionController.php

    public function getAllQuestions()
    {
        $element['#questions'] = array(1,2,3,4,5);

        $element['#title'] = 'Radio Questions';
        $element['#theme'] = 'survey';
        return $element;
    }


survey.html.twig

{#
/**
 * @file
 * Default theme implementation to print list of questions.
 *
 * Available variables:
 *   - questions
 *
 * @ingroup themeable
 */
#}
&lt;h1&gt;Test&lt;/h1&gt;


The above works fine and prints "Test" to the specified path in my .routing.yml file. However the following does not work.

survey.module

 /**
 * Implements hook_theme().
 */
function questionList_theme($existing, $type, $theme, $path)
{
    $variables = array(
        'questionList' =&gt; array(
            'variables' =&gt; array(
                'questions'    =&gt; NULL,
            ),
        ),
    );
    return $variables;
}


RadioQuestionController.php

    public function getAllQuestions()
    {
        $element['#questions'] = array(1,2,3,4,5);

        $element['#title'] = 'Radio Questions';
        $element['#theme'] = 'questionList';
        return $element;
    }


questionList.html.twig

{#
/**
 * @file
 * Default theme implementation to print list of questions.
 *
 * Available variables:
 *   - questions
 *
 * @ingroup themeable
 */
#}
&lt;h1&gt;Test&lt;/h1&gt;


Is there something that I am missing that I need to change other than what is changed in the above code? Or is there something else going on?
function questionList_theme(...)


must have the name of the module, like :

function survey_theme($existing, $type, $theme, $path)
{
    $variables = array(
        'questionList' =&gt; array(
            'variables' =&gt; array(
                'questions'    =&gt; NULL,
            ),
        ),
    );
    return $variables;
}


will work.