Test suite failed: jQuery is not defined
See original GitHub issueDescription
I have imported jquery and the resizable widget in a component in this way:
import $ from "jquery";
import 'jquery-ui/themes/base/resizable.css';
import 'jquery-ui/ui/widgets/resizable';
It worked fine but when I try to run the unit test it returns this error:
Test suite failed to run
ReferenceError: jQuery is not defined
what can I do? Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (8 by maintainers)
Top Results From Across the Web
reactjs jest jQuery is not defined - Stack Overflow
Jest error: Test suite failed to run, how to solve? 4 · ReferenceError: window is not defined. I got this error when I...
Read more >5 Easy Ways to Fix the "jQuery is Not Defined" Error - Kinsta
The "jQuery is not defined" error means a call for a specific jQuery that wasn't available when the website loaded. Here's how to...
Read more >jQuery is not defined: Common causes and a simple solution
What are the common causes of jQuery is not defined? · 1. Your CDN-hosted jQuery might be blocked · 2. Your CDN-hosted jQuery...
Read more >WordPress jQuery Is Not Defined Error: 4 Effective Ways to Fix It
WordPress jQuery is not defined error is usually caused by mistake in the code. Check out this article to learn 4 methods to...
Read more >Uncaught ReferenceError: $ is not defined
Basically $ is an alias of jQuery() so when you try to call/access it before declaring the function, it will endup throwing this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems like it works with this:
I sent a PR: https://github.com/FrancescaBarbazeni/jquery-not-defined/pull/1.
I would add that this is pretty broken (on jQuery side) as it’s not really compatible with modern bundlers, and you might have better luck using React-specific libraries instead. But it seems to work.
Hope it helps!
I’m not sure really, depends on what exactly you’re looking for. If I search for “resizable table reactjs” I find a bunch of components, maybe one will match your needs!