Я использую Flask-Bootstrap для создания своего сайта, и я очень новичок в этом.
Я обнаружил следующую ошибку в следующем файле:
<script
src="/static/vendor/bootstrap/js/bootstrap.bundle.min.js">
</script>
Когда я добавляю ссылку на панель навигации, как показано ниже
<a class="nav-link js-scroll-trigger" href="{{ url_for('team') }}">Team</a>
В консоли разработчика Chrome появляется следующая ошибка, и файл не работает:
Uncaught DOMException: Failed to execute 'querySelector' on 'Document': '/upload' is not a valid selector.
at Object.getSelectorFromElement (http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:1377)
at http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:67292
at Array.map (<anonymous>)
at n.t.refresh (http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:67266)
at new n (http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:66907)
at HTMLBodyElement.<anonymous> (http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:69792)
at Function.each (http://127.0.0.1:5000/static/vendor/jquery/jquery.min.js:2:2573)
at w.fn.init.each (http://127.0.0.1:5000/static/vendor/jquery/jquery.min.js:2:1240)
at w.fn.init.n._jQueryInterface [as scrollspy] (http://127.0.0.1:5000/static/vendor/bootstrap/js/bootstrap.bundle.min.js:6:69744)
at http://127.0.0.1:5000/static/js/agency.min.js:7:462
Но когда я не добавляю ссылку на панель навигации, файл js работает как положено.
Как я могу преодолеть эту ошибку, пожалуйста?
Большое спасибо,
Ishack