{"record":{"id":"61586dfc94d4c6cb","repo":"twbs/bootstrap","slug":"bootstrap-s-dropdowns-require-popper-https-popp","errorCode":null,"errorMessage":"Bootstrap's dropdowns require Popper (https://popper.js.org/docs/v2/)","messagePattern":"Bootstrap's dropdowns require Popper \\(https://popper\\.js\\.org/docs/v2/\\)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"js/src/dropdown.js","lineNumber":227,"sourceCode":"    EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n  }\n\n  _getConfig(config) {\n    config = super._getConfig(config)\n\n    if (typeof config.reference === 'object' && !isElement(config.reference) &&\n      typeof config.reference.getBoundingClientRect !== 'function'\n    ) {\n      // Popper virtual elements require a getBoundingClientRect method\n      throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n    }\n\n    return config\n  }\n\n  _createPopper() {\n    if (typeof Popper === 'undefined') {\n      throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org/docs/v2/)')\n    }\n\n    let referenceElement = this._element\n\n    if (this._config.reference === 'parent') {\n      referenceElement = this._parent\n    } else if (isElement(this._config.reference)) {\n      referenceElement = getElement(this._config.reference)\n    } else if (typeof this._config.reference === 'object') {\n      referenceElement = this._config.reference\n    }\n\n    const popperConfig = this._getPopperConfig()\n    this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n  }\n\n  _isShown() {\n    return this._menu.classList.contains(CLASS_NAME_SHOW)","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/twbs/bootstrap/blob/6177d5f8497f2c08f9874f5221fd17ce5acd2ad7/js/src/dropdown.js#L209-L245","documentation":"Dropdown._createPopper() (dropdown.js:225) runs when a menu is first shown and throws when the Popper namespace is undefined. In the source, Popper is an ESM import from @popperjs/core, but the standalone UMD build (dist/js/bootstrap.js) keeps it external and expects a window.Popper global — so this error means the positioning library never became available. bootstrap.bundle.js and npm/ESM usage include Popper and do not hit this path.","triggerScenarios":"Loading dist/js/bootstrap.js without a <script> for @popperjs/core; the Popper CDN request 404-ing or being blocked by an ad blocker while bootstrap.js loads from cache; a bundler config that marks @popperjs/core external for UMD output without providing the global; jsdom test setups that never load the Popper script.","commonSituations":"CDN setups mixing slim and bundle builds; offline development; corporate proxies stripping CDN scripts; custom Rollup/webpack builds of the component source; upgrading a page that previously bundled everything.","solutions":["Switch to the bundle build that already contains Popper: dist/js/bootstrap.bundle(.min).js.","Or load Popper's UMD build before bootstrap.js: <script src=\"https://cdn.jsdelivr.net/npm/@popperjs/core@2/dist/umd/popper.min.js\"></script>.","With npm, import from 'bootstrap' so the bundler resolves @popperjs/core itself.","Check the Network tab — the popper script must load successfully (no 404, not blocked)."],"exampleFix":"<!-- before: UMD build without Popper -->\n<script src=\"bootstrap.min.js\"></script>\n<script>new bootstrap.Dropdown(document.querySelector('.dropdown-toggle'))</script>\n<!-- TypeError: Bootstrap's dropdowns require Popper -->\n\n<!-- after, option A: the bundle that contains Popper -->\n<script src=\"bootstrap.bundle.min.js\"></script>\n\n<!-- after, option B: Popper first, then bootstrap -->\n<script src=\"https://cdn.jsdelivr.net/npm/@popperjs/core@2/dist/umd/popper.min.js\"></script>\n<script src=\"bootstrap.min.js\"></script>","handlingStrategy":"validation","validationCode":"function ensurePopper() {\n  if (typeof window !== 'undefined' && typeof window.Popper === 'undefined') {\n    throw new Error('Popper is missing — load bootstrap.bundle.js or @popperjs/core UMD before bootstrap.js')\n  }\n}\nensurePopper()\nbootstrap.Dropdown.getOrCreateInstance(toggleEl).toggle()","typeGuard":null,"tryCatchPattern":"try {\n  bootstrap.Dropdown.getOrCreateInstance(toggleEl).toggle()\n} catch (err) {\n  if (err instanceof TypeError && /require Popper/.test(err.message)) {\n    // positioning library missing: show a CSS-only fallback menu or load popper, then retry once\n  } else {\n    throw err\n  }\n}","preventionTips":["Standardize script-tag builds on dist/js/bootstrap.bundle.min.js.","When using plain bootstrap.js, always place the @popperjs/core UMD <script> before it.","Check the Network tab for popper 404s or ad-blocker interference on failing pages.","Never mark @popperjs/core external for UMD output in custom builds."],"tags":["bootstrap","dropdown","popper","missing-dependency","umd","cdn"],"backgroundTag":"missing-dependency","analyzedSha":"6177d5f8497f2c08f9874f5221fd17ce5acd2ad7","analyzedAt":"2026-08-22T03:20:03.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}