0👍
✅
I figured it out, require
works while import does not.
// Declare $ and jQuery globally into my whole app :(
window.$ = window.jQuery = jQuery;
// this does not work
// import collapse from 'path/to/bootstrap/feature/collapse.js";
require('path/to/bootstrap/feature/collapse.js');
0👍
- Verify that jQuery isn’t already loaded. Loading it twice might cause some issues. Remove your jquery import and maybe check in
console.log($)
if they’ve built it on jQuery chances are it’s already there. - If 1. fails you have to import jQuery in you main js file or to import it globally.
Source:stackexchange.com