Bootstrap 5.2 compiled js Codekit not the same as bootstrap.bundle.js
Prerequisites
- [X] I have searched for duplicate or closed issues
- [X] I have validated any HTML to avoid common problems
- [X] I have read the contributing guidelines
Describe the issue
Hi,
I have a Bootstrap 5.2 project in Codekit latest version and Codekit compiles the Bootstrap js like this in main.js:
import 'bootstrap/js/dist/alert'; import 'bootstrap/js/dist/button'; import 'bootstrap/js/dist/carousel'; import 'bootstrap/js/dist/collapse'; import 'bootstrap/js/dist/dropdown'; import 'bootstrap/js/dist/modal'; import 'bootstrap/js/dist/offcanvas'; import 'bootstrap/js/dist/popover'; import 'bootstrap/js/dist/scrollspy'; import 'bootstrap/js/dist/tab'; import 'bootstrap/js/dist/toast'; import 'bootstrap/js/dist/tooltip'; import '@popperjs/core/lib/index.js'
This gives me the following error in the console:
theme.min.js:1 Uncaught ReferenceError: bootstrap is not defined
at theme.min.js:1:5938
at Array.map (
at theme.min.js:1:5921
at theme.min.js:1:11309
Now when I replace the Codekit main.js with bootstrap.bundle.js from the node_modules the error is gone!
My question is what is the difference between the above showed compiled Bootstrap 5 modules in Codekit (what is missing?) and bootstrap.bundle.js that works perfect.
Thanks,
David
Reduced test cases
Compare complied js with bootstrap.bundle.js
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.2