bootstrap is not defined using the latest beta

Author: samusaranCreated Apr 7, 2022Updated Dec 1, 2024
Labelsbug

I'm currently trying to use bootstrap-select in a Power BI Visual (a self contained typescript app).

I'm using:

  • bootstrap-select: 1.14.0-beta2
  • bootstrap: 5.1.3
  • jQuery: 3.6.0

When I try to load the app the following error occurs:

Uncaught ReferenceError: bootstrap is not defined
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:66864
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:69450
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:66127
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:66131
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:69452
    __webpack_require__ https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:21
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:16380
    __webpack_require__ https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:21
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:40995
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:41021
    __webpack_require__ https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:21
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:40986
    __webpack_require__ https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:21
    dropDownSearchafeb36a4713049c88e660b96c9f9ce89_DEBUG https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:85
    <anonymous> https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT line 19 > injectedScript:88
    <anonymous> https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    f https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    loadWithoutResourcePackage https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    executeMessage https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    onMessageReceived https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    m https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    invokeHandler https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    dispatchMessage https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    onMessageReceived https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    windowMessageHandler https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    dispatch https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    handle https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    add https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    ke https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    each https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    each https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    ke https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    on https://app.powerbi.com/13.0.17993.49/scripts/visualsandbox.minimal.externals.min.js:146
    n https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    createWindowMessageProxy https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:19
    createSandboxHost https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    createSandboxHost https://app.powerbi.com/13.0.17993.49/scripts/customVisualsHost.bundle.min.js:20
    <anonymous> https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT:28
    EventListener.handleEvent* https://app.powerbi.com/13.0.17993.49/cvSandboxMinimal.html?locale=it-IT:26
cvSandboxMinimal.html:66864:20

Sadly I cannot use bootstrap <5 because I can't make it compile (i always get an error on the CSS compilation, that I don't get with bootstrap 5)

Source: snapappointments/bootstrap-select