question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

trouble importing jquery

See original GitHub issue

Having difficulty when importing jquery in create-react-app project. when adding in import $ from 'jquery' with a npm -v of 3.10.10, will receive the following when logging $ : // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery…. current repo: https://github.com/faurenlarr/personalsite

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
viankakrisnacommented, Sep 5, 2017

it would not be working as usual as in including it with a script tag, you need to import $ every time you want to use jquery in a file.

so adding import $ from 'jquery' to the top of this file https://github.com/faurenlarr/personalsite/blob/master/src/main.js file should make the commented code work. (if you uncomment it of course 😄)

1reaction
faurenlarrcommented, Sep 7, 2017

That helped, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to import jquery using ES6 syntax? - Stack Overflow
The issue is that when using import syntax angular.js and jquery will always be imported before you have a chance to assign jquery...
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 >
How to use jQuery with Laravel and Vite - DevDojo
Fret not, because in this post we will go over how to install it, import it, and how to use it with Laravel...
Read more >
jQuery Get Started - W3Schools
Adding jQuery to Your Web Pages. There are several ways to start using jQuery on your web site. You can: Download the jQuery...
Read more >
Proper way to import the jQuery library to a webpage.
After several days of trying to figure out EXACTLY how to import the jQuery library so that I can use it in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found