{"record":{"id":"74409d99f6536f99","repo":"twbs/bootstrap","slug":"no-method-named-config-74409d","errorCode":null,"errorMessage":"No method named \"${config}\"","messagePattern":"No method named \"(.+?)\"","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"js/src/tab.js","lineNumber":277,"sourceCode":"    return elem.matches(SELECTOR_INNER_ELEM) ? elem : SelectorEngine.findOne(SELECTOR_INNER_ELEM, elem)\n  }\n\n  // Try to get the outer element (usually the .nav-item)\n  _getOuterElement(elem) {\n    return elem.closest(SELECTOR_OUTER) || elem\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tab.getOrCreateInstance(this)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * Data API implementation\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n  if (['A', 'AREA'].includes(this.tagName)) {\n    event.preventDefault()\n  }\n\n  if (isDisabled(this)) {\n    return","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/twbs/bootstrap/blob/6177d5f8497f2c08f9874f5221fd17ce5acd2ad7/js/src/tab.js#L259-L295","documentation":"Tab's jQueryInterface creates the instance without forwarding any config — Tab.getOrCreateInstance(this) — then dispatches the string with the strict guard (no '_', no 'constructor'). Tab has exactly two public methods: show and dispose. There is no toggle or activate method.","triggerScenarios":"$('#tab').tab('toggle') — no toggle on Tab; $('#tab').tab('activate') — jQuery UI vocabulary; $('#tab').tab('constructor') or any '_'-prefixed name; $('#tab').tab('hide') — Tab manages activation via show only.","commonSituations":"Porting jQuery UI tabs code ('activate'); assuming symmetric show/hide pairs on every component; dynamic tab switching code that interpolates method names.","solutions":["Use show or dispose — Tab's entire public surface.","To deactivate a tab, show its sibling tab; there is no hide/toggle.","Replace jQuery UI 'activate' with 'show'.","For dynamic dispatch, prefer bootstrap.Tab.getOrCreateInstance(el).show()."],"exampleFix":"// before\n$('#tab').tab('toggle') // TypeError: No method named \"toggle\"\n\n// after\n$('#tab').tab('show') // show | dispose","handlingStrategy":"validation","validationCode":"function callTabMethod(element, method) {\n  const instance = bootstrap.Tab.getOrCreateInstance(element)\n  const callable = typeof instance[method] === 'function' &&\n    !method.startsWith('_') && method !== 'constructor'\n  if (!callable) {\n    console.warn(`Tab: ignoring unknown method \"${method}\"`)\n    return\n  }\n  instance[method]()\n}","typeGuard":"const TAB_METHODS = ['show', 'dispose'] as const\ntype TabMethod = (typeof TAB_METHODS)[number]\nconst isTabMethod = (m: string): m is TabMethod =>\n  (TAB_METHODS as readonly string[]).includes(m)","tryCatchPattern":"try {\n  $('#tab').tab(method)\n} catch (err) {\n  if (err instanceof TypeError && err.message.startsWith('No method named')) {\n    console.warn(`Tab: unknown method \"${method}\"`)\n  } else {\n    throw err\n  }\n}","preventionTips":["Tab has exactly two methods: show and dispose — whitelist to those.","Deactivate a tab by showing its sibling; there is no hide/toggle.","Translate jQuery UI 'activate' to 'show'.","Prefer bootstrap.Tab.getOrCreateInstance(el).show()."],"tags":["bootstrap","tab","jquery","typeerror","method-dispatch"],"backgroundTag":"invalid-method-name","analyzedSha":"6177d5f8497f2c08f9874f5221fd17ce5acd2ad7","analyzedAt":"2026-08-22T03:20:03.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}