I want to import 'jquery-validation' into an ES6 class
import $ from 'jquery'
import 'jquery-validation'
but when I do anywhere in the same file
$(...).validate({...})
I get the error
Uncaught TypeError: $(...).validate is not a function
From the looks of your code example you weren't importing it correctly. Works 👌 for me with the following imports (with Webpack bundling):
import $ from 'jquery'
import validate from 'jquery-validation'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With