Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import jQuery Validation

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
like image 470
philip_nunoo Avatar asked Aug 20 '16 01:08

philip_nunoo


1 Answers

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'
like image 85
Brad Adams Avatar answered Sep 22 '22 02:09

Brad Adams