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
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
Share
Improve this question
edited Aug 20, 2016 at 1:22
Michał Perłakowski
92.6k30 gold badges163 silver badges186 bronze badges
asked Aug 20, 2016 at 1:20
philip_nunoophilip_nunoo
9384 gold badges10 silver badges22 bronze badges
1
-
What method did you use to make your
import
statement available on the browser? I have a gulpbrowserify
task withbabelify
transform that works just fine ( I have the same import statements you wrote above). Check these references: github./babel/babelify, egorsmirnov.me/2015/05/25/browserify-babelify-and-es6.html – Gabriel Ferraz Commented Dec 13, 2016 at 15:13
2 Answers
Reset to default 13From the looks of your code example you weren't importing it correctly. Works