Uncaught ReferenceError: JQuery Is Not Defined VueJS Parcel
I have this: import jQuery from 'jquery' import HSCore from './components/assets/js/hs.core.js' Yet I still get this: Uncaught ReferenceError: jQuery is not defined at Objec
Solution 1:
This will do it:
const { $, jQuery } = require('jquery');
global.$ = $;
global.jQuery = jQuery;
require( './components/assets/js/hs.core.js');//<-- this made it work with all the above code too
// $ object now exists: $(“#el”)
// jQuery now exists: jQuery(“#el”)
Solution 2:
Try this
global.jQuery = require('/assets/js/script');
var $ = global.jQuery;
window.jQuery = $;
Post a Comment for "Uncaught ReferenceError: JQuery Is Not Defined VueJS Parcel"