Hello,
I use Bootstrap 5 CSS framework.
I have a modal window to create / edit a type.
When I click on the save button, I don't use the bootstrap attributes, I have to close the modal window using Javascript in order to be able not to close the window in case of a validation error.
I have written the code in the bootstrap documentation.
document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('closeModal', () => {
var modal = new bootstrap.Modal('#typeForm');
modal.hide();
});
});
But I have this error.
Uncaught ReferenceError: bootstrap is not defined
I don't understand why bootstrap is not defined. I have this in my bootstrap.js file.
window._ = require('lodash');
import "bootstrap";
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Do you have any idea how to solve this issue ?
Thanks for your help.
Vincent
PS I'm French and I often see issue instead of problem or bug. What's the official word ? What's exactly an issue in English ?