{"record":{"id":"e235bbe6f74aabcd","repo":"dotnet/AspNetCore.Docs","slug":"popover-requires-tooltip-js-e235bb","errorCode":null,"errorMessage":"Popover requires tooltip.js","messagePattern":"Popover requires tooltip\\.js","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"aspnetcore/mvc/controllers/testing/samples/3.x/TestingControllersSample/src/TestingControllersSample/wwwroot/js/bootstrap.js","lineNumber":1797,"sourceCode":"   * Bootstrap: popover.js v3.3.7\n   * http://getbootstrap.com/javascript/#popovers\n   * ========================================================================\n   * Copyright 2011-2016 Twitter, Inc.\n   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n   * ======================================================================== */\n  \n  \n  +function ($) {\n    'use strict';\n  \n    // POPOVER PUBLIC CLASS DEFINITION\n    // ===============================\n  \n    var Popover = function (element, options) {\n      this.init('popover', element, options)\n    }\n  \n    if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')\n  \n    Popover.VERSION  = '3.3.7'\n  \n    Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {\n      placement: 'right',\n      trigger: 'click',\n      content: '',\n      template: '<div class=\"popover\" role=\"tooltip\"><div class=\"arrow\"></div><h3 class=\"popover-title\"></h3><div class=\"popover-content\"></div></div>'\n    })\n  \n  \n    // NOTE: POPOVER EXTENDS tooltip.js\n    // ================================\n  \n    Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)\n  \n    Popover.prototype.constructor = Popover\n  ","sourceCodeStart":1779,"sourceCodeEnd":1815,"githubUrl":"https://github.com/dotnet/AspNetCore.Docs/blob/c67a80103a1a74db20784debd919c7fdda96c510/aspnetcore/mvc/controllers/testing/samples/3.x/TestingControllersSample/src/TestingControllersSample/wwwroot/js/bootstrap.js#L1779-L1815","documentation":"Identical guard to error 1 in the 3.x sample: popover.js asserts `$.fn.tooltip` exists at load time because Popover extends Tooltip. Missing tooltip.js or wrong order triggers the throw.","triggerScenarios":"Loading popover.js without/after tooltip.js in the 3.x sample; custom Bootstrap build omitting the tooltip module.","commonSituations":"Script-tag ordering in the 3.x layout; bundler reordering; minimal Bootstrap download.","solutions":["Include tooltip.js before popover.js, or use the full bootstrap.js bundle.","Ensure the tooltip module is present in any custom build that includes popover."],"exampleFix":"// before\n<script src=\"popover.js\"></script>\n<script src=\"tooltip.js\"></script>\n// after\n<script src=\"tooltip.js\"></script>\n<script src=\"popover.js\"></script>","handlingStrategy":"validation","validationCode":"if (typeof jQuery === 'undefined' || !jQuery.fn || !jQuery.fn.tooltip) {\n  console.error('tooltip.js missing; Popover unavailable');\n} else {\n  $('#el').popover();\n}","typeGuard":"function bootstrapTooltipAvailable() { return typeof jQuery !== 'undefined' && !!jQuery.fn && typeof jQuery.fn.tooltip === 'function'; }","tryCatchPattern":"try {\n  $('#el').popover();\n} catch (e) {\n  if (/Popover requires tooltip\\.js/.test(e.message)) {\n    console.error('Include tooltip.js before popover.js');\n  } else { throw e; }\n}","preventionTips":["Use the full bootstrap.js bundle to guarantee plugin order.","Keep script includes in a single layout with a fixed order.","CI-check that tooltip.js precedes popover.js in the bundle."],"tags":["bootstrap","popover","tooltip","load-order","script-tags"],"backgroundTag":null,"analyzedSha":"c67a80103a1a74db20784debd919c7fdda96c510","analyzedAt":"2026-08-13T17:46:11.763Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}