{"record":{"id":"fbeacb93dbcabebc","repo":"twbs/bootstrap","slug":"no-method-named-config-fbeacb","errorCode":null,"errorMessage":"No method named \"${config}\"","messagePattern":"No method named \"(.+?)\"","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"js/src/popover.js","lineNumber":83,"sourceCode":"      [SELECTOR_CONTENT]: this._getContent()\n    }\n  }\n\n  _getContent() {\n    return this._resolvePossibleFunction(this._config.content)\n  }\n\n  // Static\n  static jQueryInterface(config) {\n    return this.each(function () {\n      const data = Popover.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(Popover)\n\nexport default Popover\n","sourceCodeStart":65,"sourceCodeEnd":98,"githubUrl":"https://github.com/twbs/bootstrap/blob/6177d5f8497f2c08f9874f5221fd17ce5acd2ad7/js/src/popover.js#L65-L98","documentation":"Popover reuses Tooltip's method surface through class inheritance, and its jQueryInterface throws when the string is not found on the instance (simple undefined check). Public methods are show, hide, toggle, enable, disable, toggleEnabled, update, setContent and dispose. The content API added in 5.2 is setContent — updateContent does not exist.","triggerScenarios":"$('#pop').popover('updateContent', {...}) — correct is setContent; $('#pop').popover('destroy') — v4 name, v5 is dispose; $('#pop').popover('open'); $('#pop').popover('setContentX').","commonSituations":"v4→v5 migrations ('destroy' → 'dispose'); developers guessing updateContent because setContent arrived mid-5.x; mixing Tooltip/Popover verbs with other UI libraries.","solutions":["Use the inherited Tooltip methods: show, hide, toggle, enable, disable, toggleEnabled, update, setContent, dispose.","Replace 'destroy' with 'dispose' (v5 rename).","Use setContent({ '.popover-body': '...' }) for dynamic content, not updateContent.","Validate dynamic names against bootstrap.Popover.getInstance(el) before calling."],"exampleFix":"// before\n$('#pop').popover('updateContent', 'Hi') // TypeError: No method named \"updateContent\"\n\n// after\n$('#pop').popover('setContent', { '.popover-body': 'Hi' })","handlingStrategy":"validation","validationCode":"function callPopoverMethod(element, method, ...args) {\n  const instance = bootstrap.Popover.getOrCreateInstance(element)\n  if (typeof instance[method] !== 'function') {\n    console.warn(`Popover: ignoring unknown method \"${method}\"`)\n    return\n  }\n  instance[method](...args)\n}","typeGuard":"const POPOVER_METHODS = ['show', 'hide', 'toggle', 'enable', 'disable', 'toggleEnabled', 'update', 'setContent', 'dispose'] as const\ntype PopoverMethod = (typeof POPOVER_METHODS)[number]\nconst isPopoverMethod = (m: string): m is PopoverMethod =>\n  (POPOVER_METHODS as readonly string[]).includes(m)","tryCatchPattern":"try {\n  $('#pop').popover(method)\n} catch (err) {\n  if (err instanceof TypeError && err.message.startsWith('No method named')) {\n    console.warn(`Popover: unknown method \"${method}\"`)\n  } else {\n    throw err\n  }\n}","preventionTips":["Apply the v4→v5 rename: destroy → dispose.","Use setContent (5.2+) for dynamic content; updateContent does not exist.","Whitelist dynamic names against the nine inherited methods.","Prefer the vanilla API for dynamic dispatch."],"tags":["bootstrap","popover","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"}