{"record":{"id":"16aed1c6c0a95e04","repo":"Semantic-Org/Semantic-UI","slug":"cannot-search-no-source-used-and-semantic-api-mo","errorCode":null,"errorMessage":"Cannot search. No source used, and Semantic API module was not included","messagePattern":"Cannot search\\. No source used, and Semantic API module was not included","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/definitions/modules/search.js","lineNumber":1299,"sourceCode":"  onSearchQuery  : function(query){},\n  onResults      : function(response){},\n\n  onResultsOpen  : function(){},\n  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,","sourceCodeStart":1281,"sourceCodeEnd":1317,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/modules/search.js#L1281-L1317","documentation":"Search has two ways to get data: a local source (settings.source as object/array) or a remote call through the Semantic UI api module ($.fn.api). In query() (search.js:528-538) it picks local only when source is a plain object/array, otherwise falls to module.search.remote only if $.fn.api exists; if neither holds it logs error.source. It is also logged in search.object() (search.js:619-621) when the source argument is undefined/false.","triggerScenarios":"Initializing $('.ui.search').search() with no source setting while the api module (semantic-api) is not loaded; OR calling .search('search local', term) / object search with settings.source unset; OR settings.source is a string (e.g. a URL) instead of an object/array and $.fn.api is undefined.","commonSituations":"Forgetting to include semantic-ui-api.js after semantic-ui-search.js; expecting the api module to ship with search by default; setting source to a URL string thinking search will fetch it directly (search.js only treats plain objects/arrays as local data); tree-shaking/bundling that drops the api module.","solutions":["Provide a local dataset: settings.source = [{ title: '...' }, ...] so search uses the local path.","Include the api module before search: load semantic-ui-api.js (or the api sub-module) and set apiSettings.url so remote search is available.","Confirm $.fn.api is defined at runtime (typeof $.fn.api !== 'undefined') before relying on remote search."],"exampleFix":"// before\n$('.ui.search').search(); // no source, no api module -> [81]\n\n// after (local)\n$('.ui.search').search({ source: [{title:'A'}, {title:'B'}] });\n// after (remote, requires semantic-ui-api)\n$('.ui.search').search({ type: 'category', apiSettings: { url: '/api/search?q={query}' } });","handlingStrategy":"validation","validationCode":"// Ensure at least one data path is available\nvar hasLocal = $.isPlainObject(cfg.source) || $.isArray(cfg.source);\nvar hasApi = typeof $.fn.api !== 'undefined';\nif (!hasLocal && !hasApi) {\n  throw new Error('Search needs a local source or the semantic-ui-api module loaded.');\n}\n$('.ui.search').search(cfg);","typeGuard":"function isLocalSource(s){ return $.isPlainObject(s) || $.isArray(s); }","tryCatchPattern":null,"preventionTips":["Always provide settings.source for local search.","Confirm $.fn.api is loaded before enabling remote search.","Remember source must be an object/array, not a URL string, for the local path."],"tags":["search","source","api-module","semantic-ui","console-error"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}