{"record":{"id":"da6539c44322003d","repo":"dotnet/AspNetCore.Docs","slug":"popover-requires-tooltip-js","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/2.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/2.x/TestingControllersSample/src/TestingControllersSample/wwwroot/js/bootstrap.js#L1779-L1815","documentation":"Bootstrap 3.3.7 ships its plugins as separate files (tooltip.js, popover.js, ...). Popover extends Tooltip, so at popover.js load time it asserts `$.fn.tooltip` exists. If tooltip.js was not loaded — or was loaded after popover.js — the constructor backbone is missing and the file throws immediately on parse. This is a dependency-order guard, not a runtime user error.","triggerScenarios":"Including popover.js without tooltip.js; loading popover.js before tooltip.js; a custom Bootstrap build that omitted the tooltip module; a bundler/concatenation order that put popover first.","commonSituations":"Hand-picked script tags in _Layout.cshtml; ASP.NET bundling/minification that reorders inputs; using a stripped Bootstrap download.","solutions":["Include tooltip.js before popover.js (or just use the full bootstrap.js / bootstrap.min.js bundle which has them in order).","If using a custom build tool, ensure the tooltip module is selected whenever popover is.","Verify load order in the browser's Network/Sources tab — tooltip.js must appear before popover.js."],"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>\n// or simply\n<script src=\"bootstrap.min.js\"></script>","handlingStrategy":"validation","validationCode":"// Ensure tooltip.js loaded before relying on Popover.\nif (typeof jQuery === 'undefined' || !jQuery.fn || !jQuery.fn.tooltip) {\n  console.error('tooltip.js is missing; Popover will throw. Aborting popover init.');\n} else {\n  $('#el').popover();\n}","typeGuard":"function bootstrapTooltipAvailable() {\n  return typeof jQuery !== 'undefined' && !!jQuery.fn && typeof jQuery.fn.tooltip === 'function';\n}","tryCatchPattern":"try {\n  $('#el').popover();\n} catch (e) {\n  if (/Popover requires tooltip\\.js/.test(e.message)) {\n    console.error('Load order wrong: include tooltip.js before popover.js');\n  } else { throw e; }\n}","preventionTips":["Use the full bootstrap bundle instead of individual plugin files.","Centralize script includes in one layout file in a fixed order.","Add a CI check that greps script tags for tooltip.js preceding popover.js."],"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"}