Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"jQuery is not defined" when using the NPM installation method. #26

Closed
JulsWlf opened this issue Nov 23, 2016 · 4 comments
Closed

"jQuery is not defined" when using the NPM installation method. #26

JulsWlf opened this issue Nov 23, 2016 · 4 comments

Comments

@JulsWlf
Copy link

JulsWlf commented Nov 23, 2016

I followed the NPM installation method:

"use strict";
let $ = require("jquery");
require("jquery-simple-timer")($);

$(() => {
  $('.timer').startTimer();
});

and it says jQuery is not defined.

Not sure if this has something to do with the fact that Im transpiling ES6 code using babelify and browserify.

Note: The jQuery is not defined comes from the plugin file itself "jquery.simple.timer.js:189"

Thanks in advance!

@caike
Copy link
Owner

caike commented Nov 26, 2016

Hmm.. maybe this is my fault since I haven't yet published the latest version of this to npm (#19).
But either way, jQuery should be installed prior to using this plugin - it is not installed automatically. Have you tried installing jQuery first and then using the plugin straight from the source file ? Transpiling should not be an issue.

@JulsWlf
Copy link
Author

JulsWlf commented Nov 26, 2016

Yeah, I had jQuery already installed and was importing it via CommonJS method.
Turns out it is indeed an old version in npm, I downloaded the file directly from here and it works just fine!

@caike
Copy link
Owner

caike commented Nov 28, 2016

Cool! Sorry about that. Working on a fix for #25 and as soon as I'm done with that I'll publish the new version to npm.

@caike caike closed this as completed Nov 28, 2016
@caike
Copy link
Owner

caike commented Nov 29, 2016

New version has been published to npm 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants