{"record":{"id":"774ec3f2759c3fcf","repo":"twbs/bootstrap","slug":"no-method-named-config-774ec3","errorCode":null,"errorMessage":"No method named \"${config}\"","messagePattern":"No method named \"(.+?)\"","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"js/src/tooltip.js","lineNumber":619,"sourceCode":"    }\n\n    if (this.tip) {\n      this.tip.remove()\n      this.tip = null\n    }\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Tooltip.getOrCreateInstance(this, config)\n\n      if (typeof config !== 'string') {\n        return\n      }\n\n      if (typeof data[config] === 'undefined') {\n        throw new TypeError(`No method named \"${config}\"`)\n      }\n\n      data[config]()\n    })\n  }\n}\n\n/**\n * jQuery\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n","sourceCodeStart":601,"sourceCodeEnd":634,"githubUrl":"https://github.com/twbs/bootstrap/blob/6177d5f8497f2c08f9874f5221fd17ce5acd2ad7/js/src/tooltip.js#L601-L634","documentation":"Tooltip's jQueryInterface dispatches $('#tip').tooltip(name) to the instance method name and throws when data[name] is undefined (simple undefined check, no '_' filtering). Public methods are show, hide, toggle, enable, disable, toggleEnabled, update, setContent and dispose — the same surface Popover inherits.","triggerScenarios":"$('#tip').tooltip('open') or 'close' (correct: show/hide); $('#tip').tooltip('destroy') — v4 name, v5 is dispose; $('#tip').tooltip('updateContent') — the 5.2 API is setContent; $('#tip').tooltip('position').","commonSituations":"Porting jQuery UI or v4 Bootstrap code; tutorials predating the 5.2 setContent API; guessing verbs for positioning ('position', 'place') where update is the reposition call.","solutions":["Use the public methods: show, hide, toggle, enable, disable, toggleEnabled, update, setContent, dispose.","Replace 'destroy' with 'dispose' and 'open'/'close' with 'show'/'hide'.","Use setContent({ '.tooltip-inner': '...' }) for dynamic content.","For dynamic names, check typeof bootstrap.Tooltip.getInstance(el)?.[name] === 'function' first."],"exampleFix":"// before\n$('#tip').tooltip('open') // TypeError: No method named \"open\"\n\n// after\n$('#tip').tooltip('show') // show|hide|toggle|enable|disable|toggleEnabled|update|setContent|dispose","handlingStrategy":"validation","validationCode":"function callTooltipMethod(element, method, ...args) {\n  const instance = bootstrap.Tooltip.getOrCreateInstance(element)\n  if (typeof instance[method] !== 'function') {\n    console.warn(`Tooltip: ignoring unknown method \"${method}\"`)\n    return\n  }\n  instance[method](...args)\n}","typeGuard":"const TOOLTIP_METHODS = ['show', 'hide', 'toggle', 'enable', 'disable', 'toggleEnabled', 'update', 'setContent', 'dispose'] as const\ntype TooltipMethod = (typeof TOOLTIP_METHODS)[number]\nconst isTooltipMethod = (m: string): m is TooltipMethod =>\n  (TOOLTIP_METHODS as readonly string[]).includes(m)","tryCatchPattern":"try {\n  $('#tip').tooltip(method)\n} catch (err) {\n  if (err instanceof TypeError && err.message.startsWith('No method named')) {\n    console.warn(`Tooltip: unknown method \"${method}\"`)\n  } else {\n    throw err\n  }\n}","preventionTips":["Translate old vocabulary: open/close→show/hide, destroy→dispose.","Use setContent for dynamic content; update only repositions.","Whitelist dynamic names against the nine public methods.","Prefer the vanilla API for dynamic dispatch."],"tags":["bootstrap","tooltip","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"}