{"record":{"id":"6f10c0aa67e55060","repo":"padrino/padrino-framework","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":"padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js","lineNumber":20,"sourceCode":" * Bootstrap: popover.js v3.1.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.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {\n    placement: 'right',\n    trigger: 'click',\n    content: '',\n    template: '<div class=\"popover\"><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\n  Popover.prototype.getDefaults = function () {\n    return Popover.DEFAULTS","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/padrino/padrino-framework/blob/167044f3d56b2bce12f943eb826fdb0b0ea94375/padrino-admin/lib/padrino-admin/generators/templates/assets/javascripts/bootstrap/popover.js#L2-L38","documentation":"This vendored Bootstrap 3 popover.js ships in the padrino-admin generator templates and is copied into a generated app's public javascripts. Popover is a subclass of Bootstrap's Tooltip plugin, so at load time it checks jQuery's $.fn.tooltip and throws immediately if tooltip.js was not included first. Hitting it means the page (usually a customized admin layout or a hand-built asset bundle) loads popover.js without tooltip.js.","triggerScenarios":"A layout or manifest that includes bootstrap/popover.js but not bootstrap/tooltip.js; concatenating/precompiling the vendored admin scripts in an order that puts popover.js ahead of tooltip.js; pruning 'unused' scripts from the generated admin layout and dropping tooltip.js while elements with data-toggle='popover' remain.","commonSituations":"Customizing the admin layout and rewriting the script tags; replacing or upgrading the vendored Bootstrap copy; switching to an asset pipeline where manual or alphabetical ordering puts popover first; reusing the vendored files on a non-admin page.","solutions":["Add a script tag for bootstrap/tooltip.js ahead of popover.js in the layout","Restore the script includes emitted by `padrino g admin` — the generated admin layout already orders tooltip.js before popover.js","If concatenating assets, order the bundle so jQuery, then tooltip.js, then popover.js","If tooltips were intentionally dropped, also drop popover.js and remove any data-toggle='popover' usage"],"exampleFix":"<!-- before -->\n<script src='/javascripts/bootstrap/popover.js'></script>\n\n<!-- after -->\n<script src='/javascripts/bootstrap/tooltip.js'></script>\n<script src='/javascripts/bootstrap/popover.js'></script>","handlingStrategy":"validation","validationCode":"// before adding popover.js, verify its dependency is present\nif (window.jQuery && jQuery.fn.tooltip) {\n  // safe to include popover.js\n} else {\n  console.error('bootstrap/tooltip.js must be loaded before popover.js')\n}","typeGuard":null,"tryCatchPattern":"try {\n  $('[data-toggle=popover]').popover()\n} catch (e) {\n  if (/tooltip\\.js/.test(e.message)) { /* load tooltip.js, then retry once */ }\n  else { throw e }\n}","preventionTips":["Never reorder or prune the vendored bootstrap script list emitted by `padrino g admin`","When concatenating or precompiling assets, keep order: jQuery → tooltip.js → popover.js","Smoke-test pages using data-toggle='popover' after any layout or asset-bundle change"],"tags":["bootstrap","javascript","padrino-admin","assets","script-order"],"backgroundTag":"script-load-order","analyzedSha":"167044f3d56b2bce12f943eb826fdb0b0ea94375","analyzedAt":"2026-08-23T12:41:41.049Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}