Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: h is not a constructor #2385

Closed
edwolfe807 opened this issue Jan 28, 2020 · 3 comments
Closed

TypeError: h is not a constructor #2385

edwolfe807 opened this issue Jan 28, 2020 · 3 comments

Comments

@edwolfe807
Copy link

edwolfe807 commented Jan 28, 2020

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

​It is included, what does it want?

@edwolfe807
Copy link
Author

edwolfe807 commented Jan 29, 2020

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?

@caseyjhol
Copy link
Member

Bootstrap is not currently compatible with Popper v2. See twbs/bootstrap#29842.

@khyatibhojawala
Copy link

<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

I solved my error by this cdn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants