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

Cannot read property 'jQuery' of undefined #200

Open
zomars opened this issue Oct 27, 2016 · 15 comments
Open

Cannot read property 'jQuery' of undefined #200

zomars opened this issue Oct 27, 2016 · 15 comments

Comments

@zomars
Copy link
Contributor

zomars commented Oct 27, 2016

I'm getting this error when the file is being concatenated in a minified file and it's pointing to this line.

@dmitrylebedev
Copy link

Hi, I delete temporary this from string this.jQuery and left this:

$ = window.jQuery;

@zomars
Copy link
Contributor Author

zomars commented Oct 28, 2016

Tha's what I did too.

@leafo
Copy link
Owner

leafo commented Nov 1, 2016

Is this something about your setup that would have jQuery not be available in the name jQuery?

@zomars
Copy link
Contributor Author

zomars commented Nov 1, 2016

jQuery is available, but not under the "this" namespace. If it helps to know, I'm using the jquery dist file from bower. And the only thing I'm doing is concatenating those files in the correct order.

@leafo
Copy link
Owner

leafo commented Nov 2, 2016

this should default to window, is the library getting wrapped in something that's changing that?

@tim-field
Copy link

Yeah can confirm that this.jQuery is causing this module to be unusable with a modern build system ( browserify or webpack ) Can it just be removed ?

@zomars
Copy link
Contributor Author

zomars commented Nov 3, 2016

It's not getting wrapped and it's the first file being called.

zomars added a commit to zomars/sticky-kit that referenced this issue Nov 4, 2016
@zomars zomars mentioned this issue Nov 4, 2016
leafo added a commit that referenced this issue Nov 4, 2016
@rebusweb
Copy link

rebusweb commented Dec 1, 2016

@leafo could you please update npm package for v1.3 ?

@maurobringolf
Copy link

Am I missing something or is this still a thing? I installed the lib via npm (1.1.3 on npm), but still have the this.jQuery in it. I see that the current version here on GitHub has it fixed, but still get the old code and error from npm.

@rebusweb
Copy link

rebusweb commented Oct 11, 2017

@maurobringolf Don't use npm package, use npm and github link github:leafo/sticky-kit

@maurobringolf
Copy link

@rebusweb Will this install master branch or latest release on github? Thanks for the hint! But this is a workaround, right?

@rebusweb
Copy link

@maurobringolf it's master, but you can also use github:username/package#commit convention.
yes, it's kind of a workaround, but using github links in npm is a standard functionality.

@maurobringolf
Copy link

Awesome, thank you very much!

@OnkelTem
Copy link

How do you guys manage to build it?
I get another error: #248

@rebusweb How do you include it? Do you use Browserify?

@rebusweb
Copy link

@OnkelTem nope.

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

7 participants