{"record":{"id":"89ee2b3e0393862d","repo":"apache/hadoop","slug":"bootstrap-s-javascript-requires-jquery","errorCode":null,"errorMessage":"Bootstrap's JavaScript requires jQuery","messagePattern":"Bootstrap's JavaScript requires jQuery","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/bootstrap-3.4.1/js/bootstrap.js","lineNumber":8,"sourceCode":"/*!\n * Bootstrap v3.4.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under the MIT license\n */\n\nif (typeof jQuery === 'undefined') {\n  throw new Error('Bootstrap\\'s JavaScript requires jQuery')\n}\n\n+function ($) {\n  'use strict';\n  var version = $.fn.jquery.split(' ')[0].split('.')\n  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {\n    throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')\n  }\n}(jQuery);\n\n/* ========================================================================\n * Bootstrap: transition.js v3.4.1\n * https://getbootstrap.com/docs/3.4/javascript/#transitions\n * ========================================================================\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * ======================================================================== */\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/bootstrap-3.4.1/js/bootstrap.js#L1-L26","documentation":"bootstrap.js (the Bootstrap 3.4.1 bundle shipped under hadoop-hdfs webapps/static) begins with a guard: if typeof jQuery === 'undefined' it throws Error(\"Bootstrap's JavaScript requires jQuery\"). Bootstrap 3 plugins are jQuery plugins that attach to $.fn, so the library refuses to load when jQuery is not already defined on the page.","triggerScenarios":"Loading bootstrap.js before jquery.js in the page's script order, or jQuery failing to load entirely (404 on the /static/jquery*.js asset, blocked request, typo'd path) in an HDFS web UI or custom page that includes both.","commonSituations":"Custom JSP/HTML added to the HDFS web UI that lists scripts in the wrong order; air-gapped clusters where a CDN jQuery is blocked; pages refactored to load jQuery deferred/async while bootstrap.js still loads synchronously.","solutions":["Include jQuery before bootstrap.js: <script src=\"/static/jquery...\"> first, then bootstrap's js","Open browser devtools Network tab and confirm the jQuery request is not 404 or blocked","Make sure nothing calls jQuery.noConflict(true) and removes the global before bootstrap.js runs"],"exampleFix":"<!-- before -->\n<script src=\"/static/bootstrap-3.4.1/js/bootstrap.js\"></script>\n<script src=\"/static/jquery-3.6.0.min.js\"></script>\n\n<!-- after -->\n<script src=\"/static/jquery-3.6.0.min.js\"></script>\n<script src=\"/static/bootstrap-3.4.1/js/bootstrap.js\"></script>","handlingStrategy":"validation","validationCode":"if (typeof jQuery === 'undefined') {\n  // load jQuery before bootstrap.js, e.g. document.write or a script loader\n  var s = document.createElement('script');\n  s.src = '/static/jquery-3.6.0.min.js';\n  s.onload = function () { /* now safe to load bootstrap.js */ };\n  document.head.appendChild(s);\n}","typeGuard":"function jQueryLoaded() {\n  return typeof window.jQuery !== 'undefined';\n}","tryCatchPattern":null,"preventionTips":["Always place the jQuery <script> tag before bootstrap.js","Verify static assets are not 404 in the Network tab","Avoid jQuery.noConflict(true) on pages that use Bootstrap 3"],"tags":["javascript","bootstrap","jquery","script-order","hdfs-web-ui"],"backgroundTag":"javascript-dependency-not-loaded","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}