{"record":{"id":"3ab1ac1148c03508","repo":"Semantic-Org/Semantic-UI","slug":"a-valid-template-name-was-not-specified","errorCode":null,"errorMessage":"A valid template name was not specified.","messagePattern":"A valid template name was not specified\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/definitions/modules/search.js","lineNumber":1303,"sourceCode":"  onResultsClose : function(){},\n\n  className: {\n    animating : 'animating',\n    active    : 'active',\n    empty     : 'empty',\n    focus     : 'focus',\n    hidden    : 'hidden',\n    loading   : 'loading',\n    results   : 'results',\n    pressed   : 'down'\n  },\n\n  error : {\n    source          : 'Cannot search. No source used, and Semantic API module was not included',\n    noResults       : 'Your search returned no results',\n    logging         : 'Error in debug logging, exiting.',\n    noEndpoint      : 'No search endpoint was specified',\n    noTemplate      : 'A valid template name was not specified.',\n    oldSearchSyntax : 'searchFullText setting has been renamed fullTextSearch for consistency, please adjust your settings.',\n    serverError     : 'There was an issue querying the server.',\n    maxResults      : 'Results must be an array to use maxResults setting',\n    method          : 'The method you called is not defined.'\n  },\n\n  metadata: {\n    cache   : 'cache',\n    results : 'results',\n    result  : 'result'\n  },\n\n  regExp: {\n    escape     : /[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g,\n    beginsWith : '(?:\\s|^)'\n  },\n\n  // maps api response attributes to internal representation","sourceCodeStart":1285,"sourceCodeEnd":1321,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/modules/search.js#L1285-L1321","documentation":"In generateResults() (search.js:1013-1018) the module looks up settings.templates[settings.type] and, after producing HTML, checks whether that template is a function; if it is not (undefined because the type is unknown or the template was overwritten with a non-function), it logs error.noTemplate. Results cannot be rendered without a template function.","triggerScenarios":"settings.type set to a value with no matching entry in settings.templates (e.g. type:'custom' when only 'standard' and 'category' exist); overriding settings.templates.standard with a string/null instead of a function; calling .search() with type:'category' but no category template.","commonSituations":"Customizing the type option without supplying the matching template; removing the default templates when extending settings; version differences where a template key was renamed.","solutions":["Use a built-in type: 'standard' or 'category' (both have default templates).","If you set type:'custom', also provide settings.templates.custom = function(response, fields){ return '...'; }.","Ensure any template override remains a function returning an HTML string."],"exampleFix":"// before\n$('.ui.search').search({ type: 'fancy', source: data }); // no 'fancy' template -> [85]\n\n// after\n$('.ui.search').search({\n  type: 'fancy',\n  source: data,\n  templates: { fancy: function(response, fields){ return '<div>...</div>'; } }\n});","handlingStrategy":"type-guard","validationCode":"var type = cfg.type || 'standard';\nif (!$.isFunction(cfg.templates && cfg.templates[type])) {\n  throw new Error(\"No template function for search type '\" + type + \"'\");\n}\n$('.ui.search').search(cfg);","typeGuard":"function hasTemplate(cfg, type){ var t = (cfg.templates||{})[type||'standard']; return typeof t === 'function'; }","tryCatchPattern":null,"preventionTips":["Use only 'standard' or 'category' unless you also supply a custom template.","Keep template overrides as functions returning HTML strings.","Validate the type->template mapping at config time."],"tags":["search","template","configuration","semantic-ui","console-error"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}