Nav Bar in Bootstrap does not open in 768px responsive

Asked

Viewed 49 times

-1

Hello, when I click on the button (which only appears in the resposivity from 768px) the submenu does not open and generates the error below.

Imagem do Erro

<!doctype html>

<!-- Bootstrap CSS -->
<link rel="stylesheet" href=node_modules/bootstrap/compiler/bootstrap.css>

<link rel="stylesheet" href=node_modules/>

<nav class="nav bar navbar-expand-lg navbar-light bg-light">

    <a class="navbar-brand h1" href="#">Curso</a>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSite">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSite">
        <ul class="navbar-nav">
            <li class="nav-item">
                <a class="nav-link" href="#">Início</a>
            </li>
        </ul>
</div>
</nav>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/popper.js/dist/umd/popper.js"></script>
<script src="node_modules/bootstrap/dist/js/bootstrap.js"></script>

1 answer

0


This problem is related to version 3.5.0 jQuery. A Issue on Github has been resolved and you can find more information in the post about jQuery 3.5.1 Release.

To resolve, reinstall jQuery in version 3.5.1 (or other more current, regress to the version 3.4.3 is also an option):

npm remove jquery
npm install jquery@~3.5.1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.