{"record":{"id":"ae039bda329cc7d0","repo":"dotnet/AspNetCore.Docs","slug":"bootstrap-s-javascript-requires-jquery-version-1-9-ae039b","errorCode":null,"errorMessage":"Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4","messagePattern":"Bootstrap's JavaScript requires jQuery version 1\\.9\\.1 or higher, but lower than version 4","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":15,"sourceCode":"/*!\n * Bootstrap v3.3.7 (http://getbootstrap.com)\n * Copyright 2011-2016 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.3.7\n * http://getbootstrap.com/javascript/#transitions\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  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)\n  // ============================================================\n","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/dotnet/AspNetCore.Docs/blob/c67a80103a1a74db20784debd919c7fdda96c510/aspnetcore/mvc/views/tag-helpers/th-components/samples/RazorPagesSample/wwwroot/lib/bootstrap/js/bootstrap.js#L1-L33","documentation":"Bootstrap 3.3.7 splits `$.fn.jquery` and throws if the version is below 1.9.1 or 4+. Bootstrap 3's components rely on jQuery APIs introduced by 1.9.1 and removed/changed in jQuery 4.","triggerScenarios":"Loading jQuery 1.8 or earlier, or jQuery 4.0+, then bootstrap.js. The version check at the top of bootstrap.js parses the version string and throws.","commonSituations":"Upgrading jQuery to 3.x or 4.x without re-checking Bootstrap compatibility; mixing a newer jQuery from a CDN with an old vendored Bootstrap; multiple jQuery versions where the global is the wrong one.","solutions":["Use a jQuery version in [1.9.1, 4.0) — for Bootstrap 3.3.7, jQuery 1.12 or 2.2 or 3.x are safe.","Upgrade Bootstrap to v4/v5 if you need jQuery 4 (or Bootstrap 5 which dropped jQuery entirely).","Confirm only one jQuery loads — check `$.fn.jquery` in the console matches the intended version.","Re-vendor the matching jQuery alongside bootstrap in the project (this sample ships lib/jquery/jquery.js)."],"exampleFix":"<!-- before: jQuery 4 with Bootstrap 3 -->\n<script src=\"https://code.jquery.com/jquery-4.0.0.min.js\"></script>\n\n<!-- after: jQuery 3.7 with Bootstrap 3.3.7 -->\n<script src=\"lib/jquery/jquery.js\"></script>","handlingStrategy":"validation","validationCode":"function assertJQueryVersion() {\n  var v = $.fn.jquery.split('.').map(Number);\n  var ok = (v[0] > 1 || (v[0] === 1 && v[1] >= 9 && (v[1] > 9 || v[2] >= 1))) && v[0] < 4;\n  if (!ok) throw new Error('jQuery ' + $.fn.jquery + ' incompatible with Bootstrap 3');\n}","typeGuard":"function isCompatibleJQuery() {\n  if (typeof jQuery === 'undefined') return false;\n  var v = jQuery.fn.jquery.split('.').map(Number);\n  return v[0] >= 1 && !(v[0] < 1 || (v[0] === 1 && v[1] < 9) || v[0] >= 4);\n}","tryCatchPattern":"// Version mismatch throws at load — fix the dependency rather than catch.\n// For build-time guard:\ntry { require('bootstrap'); }\ncatch (e) { throw new Error('Resolve jQuery version first: ' + e.message); }","preventionTips":["Lock jQuery to a Bootstrap-3-compatible range (1.9.1–<4).","Run a smoke test that checks `$.fn.jquery` after bundle load.","When upgrading Bootstrap, re-check jQuery peer dependency."],"tags":["bootstrap","jquery","version-mismatch","dependency"],"backgroundTag":null,"analyzedSha":"c67a80103a1a74db20784debd919c7fdda96c510","analyzedAt":"2026-08-13T17:46:11.763Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}