Bootstrap-select: TypeError: h is not a constructor

Created on 28 Jan 2020  路  3Comments  路  Source: snapappointments/bootstrap-select

The following HTML (errorTest.jsp):

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
<!-- CSS Bootstrap 4 -->    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<!-- CSS BS4 Select -->     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.min.css" rel="stylesheet"/>

<!-- SCR JQuery -->         <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- SCR Bootstrap 4 -->    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>

<!-- SCR Popper -->         <script src="https://unpkg.com/@popperjs/core@2"></script>

<!-- SCR BS4 Select -->     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap-select.min.js"></script>
<!-- SCR BS4 Select EN -->  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/i18n/defaults-en_US.min.js"></script>
<!-- CSS Bootstrap 4 -->    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<!-- CSS BS4 Select -->     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap-select.min.css" rel="stylesheet"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <select multiple class="selectpicker" name="sites" id="sites" >
            <option value="1">Site One</option>
            <option value="2">Site Two</option>
        </select>
    </body>
</html>

I get the following console errors:

TypeError: i is undefined       util.js:56:4
TypeError: z is undefined      bootstrap-select.js:350:4
TypeError: e is undefined      defaults-en_US.min.js:8:244

Am I doing something wrong? Is there a bug fix?

EDIT forgot JQuery. Added it and rearranged the the order. Now the dropdown shows up but I get the following when I click on it:

TypeError: Bootstrap dropdown require Popper.js (https://popper.js.org) dropdown.js:155:16

Sometimes I get the following instead:

TypeError: h is not a constructor dropdown.js:177:23

鈥婭t is included, what does it want?

Most helpful comment

OK, I made it work by changing from the popper.js documented link of

<script src="https://unpkg.com/@popperjs/core@2"></script>

to

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>

Why can't I use the documented way of installing popper? Is this not compatible with popper v2? If not when will it?

All 3 comments

OK, I made it work by changing from the popper.js documented link of

<script src="https://unpkg.com/@popperjs/core@2"></script>

to

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>

Why can't I use the documented way of installing popper? Is this not compatible with popper v2? If not when will it?

Bootstrap is not currently compatible with Popper v2. See https://github.com/twbs/bootstrap/issues/29842.

I solved my error by this cdn

Was this page helpful?
0 / 5 - 0 ratings