{"record":{"id":"41331f975f01a761","repo":"dotnet/AspNetCore.Docs","slug":"popover-requires-tooltip-js-41331f","errorCode":null,"errorMessage":"Popover requires tooltip.js","messagePattern":"Popover requires tooltip\\.js","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"aspnetcore/mvc/views/tag-helpers/th-components/samples/RazorPagesSample/wwwroot/lib/bootstrap/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/views/tag-helpers/th-components/samples/RazorPagesSample/wwwroot/lib/bootstrap/js/bootstrap.js#L1779-L1815","documentation":"Bootstrap 3's Popover module checks `if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')` at definition time. Popover extends the Tooltip constructor (`Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)`), so it depends on Tooltip being loaded first.","triggerScenarios":"Loading the popover portion of bootstrap without the tooltip portion; or splitting bootstrap into modules and including popover.js before tooltip.js. In the combined bootstrap.js this only fires if tooltip was somehow stripped.","commonSituations":"Custom build of Bootstrap that excluded tooltip.js but kept popover.js; partial bundle that tree-shook away tooltip; ordering bug in a concatenated vendor bundle; manually loading only `popover.js` from the Bootstrap source.","solutions":["Load the full bootstrap.js (which includes tooltip before popover), or ensure tooltip.js precedes popover.js in any custom build.","Verify `$.fn.tooltip` is defined in the console before relying on popovers.","Use the bundled Bootstrap distribution rather than hand-picked individual component files."],"exampleFix":"<!-- before -->\n<script src=\"bootstrap/js/popover.js\"></script>\n\n<!-- after -->\n<script src=\"bootstrap/js/tooltip.js\"></script>\n<script src=\"bootstrap/js/popover.js\"></script>","handlingStrategy":"validation","validationCode":"function assertTooltipLoaded() {\n  if (!window.jQuery || !jQuery.fn.tooltip) {\n    throw new Error('Load tooltip.js before popover.js');\n  }\n}","typeGuard":"function popoverDepsReady() {\n  return typeof jQuery !== 'undefined' && typeof jQuery.fn.tooltip === 'function';\n}","tryCatchPattern":"// Build-time error — fix bundling, do not catch.\n// Guard at runtime if loading components dynamically:\nif (!$.fn.tooltip) { import('./tooltip.js').then(() => import('./popover.js')); }","preventionTips":["Use the full bootstrap.js bundle in production.","In custom builds, order tooltip before popover.","Add a post-build assertion that `$.fn.tooltip` exists."],"tags":["bootstrap","popover","tooltip","dependency","load-order"],"backgroundTag":null,"analyzedSha":"c67a80103a1a74db20784debd919c7fdda96c510","analyzedAt":"2026-08-13T17:46:11.763Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}