The jquery and bootstrap not included
See original GitHub issueI run the bower install for bootstrap:
bower install bootstrap4-dist --save
And include the css and js in my base.nunjucks file like this
<link rel="stylesheet" href="../../bower_components/bootstrap4-dist/dist/css/bootstrap.css"> <link rel="stylesheet" href="{{baseUrl}}styles/main.css"/> <script src="{{baseUrl}}scripts/main.js"></script>
… {% block scripts %}{% endblock %} <script src="../../bower_components/bootstrap4-dist/dist/js/bootstrap.min.js"></script>
The path is correct but it shows the files can’t be loaded. So I changed the link to cdn. The bootstrap style works. But it shows another error message:
Uncaught Error: Bootstrap’s JavaScript requires jQuery
Isn’t JQuery preinstalled by the generator? Please help. Thanks.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11
Top Results From Across the Web
JavaScript · Bootstrap v5.0
Plugins can be included individually (using Bootstrap's individual js/dist/*.js ), or all at once using bootstrap.js or the minified bootstrap.min.js (don't ...
Read more >Bootstrap 5 Removes jQuery Dependency - InfoQ
The Bootstrap 5 framework has removed jQuery as a requirement. It saved 85KB of minified JavaScript, which could be significant as Google starts ......
Read more >The jQuery library is not found in Bootstrap - Stack Overflow
It's because you are trying to use (as in, you're referencing the script file) Bootstrap before you reference jQuery.
Read more >Does Bootstrap include jQuery? - Quora
The Bootstrap 5 framework has removed jQuery as a requirement. It saved 85KB of minified JavaScript, which could be significant as Google starts...
Read more >How to add Bootstrap to HTML (Step by Step Guide)
Hence, before loading the Bootstrap JavaScript file, include the jQuery and ... Bootstrap 5 no longer needs jQuery as a dependency since JavaScript...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this:
npm install browserify-shim --save-dev
package.json
main.js
This is how i got it working:
npm install bootstrap-sass --save
for the javascript part:
npm install browserify-shim --save-dev
package.json
main.js
I though the
block appends styles/scripts
where supposed to be used. But apperently i was wrong, this took me a while to figure out though.@bagusflyer