Have you tried this ?
jQuery UI not loading in Laravel Mix
I have a Laravel 9 project with Laravel Mix. If I try to include the jQuery UI widgets, I get a Javascript error that $(...).draggable is not a function. I've installed jquery and jquery-ui via npm install.
I've tried several ways, including the "right" way according to the jQuery UI docs:
var draggable = require("jquery-ui/ui/widgets/draggable");
If I try the following, I don't get the "draggable is not a function" error, but nothing happens when I call the draggable function on an element:
window.$.fn.draggable = require("jquery-ui/ui/widgets/draggable");
I've tried several combinations of things. I have verified that both jQuery and jQuery UI are only getting loaded once (I had to add jQUery UI to begin with). In jQuery UI 1.13, you have to import each widget manually with the official NPM package.
I appreciate any help someoe can give. This project is a pretty standard Laravel app, so I'm not sure why it's not working. I can't be the only one using jQUery UI with a recent version of Laravel and Laravel Mix. Thanks.
Please or to participate in this conversation.