Level 33
1 like
I'm trying to import select2 in my project but i'm gotting this error in the view:
jquery-3.5.1.min.js:2 Uncaught TypeError: $(...).select2 is not a function
at HTMLDocument.<anonymous> (create:764)
at e (jquery-3.5.1.min.js:2)
at t (jquery-3.5.1.min.js:2)
I runned npm install select2
then added the require in my app.js
require('./bootstrap');
require('alpinejs');
require('jquery');
require('datatables.net');
window.ApexCharts = require('apexcharts');
window.Swal = require('sweetalert2')
require('select2');
After that I runned npm run dev and got the error when accesss the view.
What I'm doing wrong?
Please or to participate in this conversation.