{"record":{"id":"ba4661c872a7ec4b","repo":"nodejs/node","slug":"none-of-the-templates-given-were-found-s","errorCode":null,"errorMessage":"none of the templates given were found: %s","messagePattern":"none of the templates given were found: (.+?)","errorType":"exception","errorClass":"TemplatesNotFound","httpStatus":null,"severity":"error","filePath":"tools/inspector_protocol/jinja2/environment.py","lineNumber":857,"sourceCode":"\n        .. versionchanged:: 2.4\n           If `names` contains a :class:`Template` object it is returned\n           from the function unchanged.\n        \"\"\"\n        if not names:\n            raise TemplatesNotFound(message=u'Tried to select from an empty list '\n                                            u'of templates.')\n        globals = self.make_globals(globals)\n        for name in names:\n            if isinstance(name, Template):\n                return name\n            if parent is not None:\n                name = self.join_path(name, parent)\n            try:\n                return self._load_template(name, globals)\n            except TemplateNotFound:\n                pass\n        raise TemplatesNotFound(names)\n\n    @internalcode\n    def get_or_select_template(self, template_name_or_list,\n                               parent=None, globals=None):\n        \"\"\"Does a typecheck and dispatches to :meth:`select_template`\n        if an iterable of template names is given, otherwise to\n        :meth:`get_template`.\n\n        .. versionadded:: 2.3\n        \"\"\"\n        if isinstance(template_name_or_list, string_types):\n            return self.get_template(template_name_or_list, parent, globals)\n        elif isinstance(template_name_or_list, Template):\n            return template_name_or_list\n        return self.select_template(template_name_or_list, parent, globals)\n\n    def from_string(self, source, globals=None, template_class=None):\n        \"\"\"Load a template from a string.  This parses the source given and","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/tools/inspector_protocol/jinja2/environment.py#L839-L875","documentation":"Raised by Environment.select_template (jinja2 environment.py) after the loop over candidate names completes without any TemplateFound. Each candidate was tried via _load_template and each raised TemplateNotFound; the resulting TemplatesNotFound carries the list of names so the caller can see what was searched. The message format string 'none of the templates given were found: %s' is the canonical rendering of that exception.","triggerScenarios":"Calling select_template(['a.html','b.html','c.html']) when none of a/b/c exist in the loader's search paths; loader misconfigured (wrong directory, wrong package, missing template bundle); template-name typos across the board.","commonSituations":"Theme/skin fallback chains where none of the named themes are installed; deploying without the templates directory; loader rooted at the wrong path; case-sensitivity mismatch on case-sensitive filesystems.","solutions":["Verify each candidate exists with env.loader.list_templates() or by listing the loader's source paths.","Add a guaranteed default template as the final fallback in the list.","Check loader base path, package name, and filename casing against the candidates."],"exampleFix":"# before\nenv.select_template(['header_a.html','header_b.html'])\n# after\nenv.select_template(['header_a.html','header_b.html','header_default.html'])","handlingStrategy":"try-catch","validationCode":"available = set(env.loader.list_templates())\nmissing = [n for n in candidates if n not in available]\nif missing:\n    raise FileNotFoundError('templates not in loader: %s' % missing)","typeGuard":null,"tryCatchPattern":"from jinja2 import TemplatesNotFound\ntry:\n    tpl = env.select_template(candidates)\nexcept TemplatesNotFound as e:\n    tpl = env.get_template('default.html')   # last-resort fallback","preventionTips":["Verify candidate names against env.loader.list_templates() before selecting.","Append a guaranteed-present default template to every candidate list.","Check loader root path and filename casing in deployment."],"tags":["jinja2","template","loader","selection"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}