Recently I have started implementing requirejs in my project, but I have encountered a persistent issue that I am unable to resolve. The error message "Bootstrap's JavaScript requires jQuery" randomly appears when I load my application. Below are the relevant files:
.HTML
<html>
<head>
<link href="./css/bootstrap.min.css" rel="stylesheet">
<link href="./css/custom.css" rel="stylesheet">
<script data-main="scripts/main" src="scripts/vendor/require.js"></script>
</head>
<body>
...
</body>
my require.config from main.js file:
requirejs.config({
baseUrl : './scripts',
shim : {
underscore : {
exports : '_'
},
bootstrap : {
dep : [ 'jquery'],
exports: 'Bootstrap'
},
backbone : {
deps : [ 'jquery', 'underscore' ],
exports : 'Backbone'
},
marionette : {
deps : [ 'jquery', 'underscore', 'backbone' ],
exports : 'Marionette'
},
text: {
deps : [ 'jquery', 'underscore', 'backbone' ],
exports: 'Text'
}
},
paths : {
jquery : 'vendor/jquery.min',
underscore : 'vendor/underscore',
bootstrap : 'vendor/bootstrap.min',
backbone : 'vendor/backbone',
marionette : 'vendor/backbone.marionette',
text: 'vendor/text'
}
});
Although this issue occurs randomly, I am seeking assistance in identifying what I may have configured incorrectly or how I can troubleshoot the problem. Any insight would be greatly appreciated.
Thank you