{"record":{"id":"ca628a95798cd69c","repo":"dianping/cat","slug":"popover-requires-tooltip-js","errorCode":null,"errorMessage":"Popover requires tooltip.js","messagePattern":"Popover requires tooltip\\.js","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"cat-home/src/main/webapp/assets/js/uncompressed/bootstrap.js","lineNumber":1578,"sourceCode":" * Bootstrap: popover.js v3.2.0\n * http://getbootstrap.com/javascript/#popovers\n * ========================================================================\n * Copyright 2011-2014 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.2.0'\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":1560,"sourceCodeEnd":1596,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/uncompressed/bootstrap.js#L1560-L1596","documentation":"Popover is defined in a separate file from tooltip and deliberately extends $.fn.tooltip.Constructor.DEFAULTS (see the $.extend right after the guard). At file-eval time it checks whether $.fn.tooltip exists; if tooltip.js was not loaded first, popover.js throws immediately so it fails loudly instead of producing a broken plugin later.","triggerScenarios":"Including bootstrap-popover.js (or a custom build) without bootstrap-tooltip.js; concatenating bootstrap files in the wrong order; tooltip.js failing to load (404) while popover.js loads.","commonSituations":"Using the 'bootstrap.js' bundle usually avoids this — it happens with individually downloaded components, custom Bootstrap builds where tooltip was unchecked, or template pages that include popover but not tooltip.","solutions":["Load bootstrap-tooltip.js before bootstrap-popover.js (or just load the full bootstrap.js bundle, which already orders them correctly).","If using a custom build tool, add tooltip as a dependency of popover.","Verify in the Network tab that tooltip.js returned 200."],"exampleFix":"// before\n<script src=\"bootstrap-popover.js\"></script> <!-- tooltip.js missing -->\n\n// after\n<script src=\"bootstrap-tooltip.js\"></script>\n<script src=\"bootstrap-popover.js\"></script>","handlingStrategy":"validation","validationCode":"if (typeof window.jQuery === 'undefined' || !$.fn.tooltip) {\n  console.error('Load bootstrap-tooltip.js before bootstrap-popover.js (or use the full bootstrap.js).');\n}","typeGuard":"function popoverAvailable() {\n  return typeof window.jQuery === 'function' && typeof $.fn.tooltip === 'function' && typeof $.fn.popover === 'function';\n}","tryCatchPattern":null,"preventionTips":["Prefer the full bootstrap.js bundle over individual component files.","When hand-picking components, treat tooltip as a hard dependency of popover in your build config.","Watch the Network tab during integration of custom bootstrap builds."],"tags":["bootstrap","popover","tooltip","script-order","vendor"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}