We are using bootstrap in our visualforce page for modal popup. And it is working correctly on our browsers. But one user having the issue for loading jQuery. He is getting error "Uncaught Error: Bootstrap's JavaScript requires jQuery at bootstrap.min.js:6" in his console. Error Image

We are not getting any solution for this problem. We have searched for the solution and found this link In this they said to require the jQuery But If I tried this code in my visualforce page then it is giving error like "uncaught reference error: require is not defined". I am using this code to require jQuery

<script> window.jQuery = window.$ = require('jquery'); </script>

And for css, bootstrap and jQuery loading we are using below code

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

Please help us out and let me know if you have any questions Thanks


To use require(), you need to include requirejs. However, that's apparently not your problem. If it's just one user, check to see if jQuery is 404'ing, what browser they're using, etc. My immediate guesses are that they're on IE 11 or something, or a firewall/antivirus issue. Just to verify, I tested your code in a modern browser and it works fine on my device, so the problem's not the code.

  • Thanks for your response. I have included require.js file in my code and for require error is resolved. And user is using Microsoft edge browser in windows. – Darshana Feb 17 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.