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 doesn't work on node 0.10.0 #52

Closed
skerit opened this issue Mar 18, 2013 · 14 comments
Closed

jQuery doesn't work on node 0.10.0 #52

skerit opened this issue Mar 18, 2013 · 14 comments

Comments

@skerit
Copy link

skerit commented Mar 18, 2013

Note from repo owner: Just so everyone knows the state and future of the npm jQuery package, please see this Issue #59

Is it possible that jQuery's not working on node 0.10.0?
I'm getting this error:

/home/skerit/Projecten/elric-server/hawkejs/node_modules/jquery/lib/node-jquery.js:10
    window.XMLHttpRequest.prototype.withCredentials = false;
                         ^
TypeError: Cannot read property 'prototype' of undefined
    at create (/home/skerit/Projecten/elric-server/hawkejs/node_modules/jquery/lib/node-jquery.js:10:26)
    at /home/skerit/Projecten/elric-server/hawkejs/node_modules/jquery/lib/node-jquery.js:9503:18
    at Object.<anonymous> (/home/skerit/Projecten/elric-server/hawkejs/node_modules/jquery/lib/node-jquery.js:9505:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/skerit/Projecten/elric-server/hawkejs/lib/hawkejs.js:5:14)

@schliffer
Copy link

Getting the same error.

/home/user/src/git/vcd_cs/node_modules/jquery/lib/node-jquery.js:10
    window.XMLHttpRequest.prototype.withCredentials = false;
                         ^
TypeError: Cannot read property 'prototype' of undefined

@NeverI
Copy link

NeverI commented Mar 30, 2013

Same error here...
I don't know what I'm doing, but I changed the node-jquery.js fourth-fifth row's and it's start working :)

old:

if(window == null ) {
    window = require('jsdom').jsdom().createWindow();

new:

 if(!window || !window.document) {
    window = require('jsdom').createWindow();
    window.document = require('jsdom').jsdom();

(maybe need to upgrade the jsdom and xmlhttprequest packeges too)

@TechNickAI
Copy link

Having the same problem

@0xsven
Copy link

0xsven commented Mar 31, 2013

Me too! Any idea?

@TechNickAI
Copy link

I believe the problem is actually to do with the underlying jsdom library, but recent updates have fixed it. Specifically, this commit:

592ce53#package.json

Can someone publish a new version of the package that has this commit?

@zeropaper
Copy link

@NeverI I did the changes you mentioned and it worked, thanks.

For the record, I tried with node v0.10 and v0.8, reinstalled a few times.. upgrading the jsdom version ( as @gorillamania ) didn't changed anything.

@netroy
Copy link
Contributor

netroy commented May 4, 2013

#55 fixes v10 support & a bunch of other stuff.
please upvote #56 to get the package on npm.

@coolaj86
Copy link

coolaj86 commented Jun 8, 2013

Just so everyone knows the state and future of the npm jQuery package, please see this Issue #59

@kishoremaley
Copy link

The comments provided by Never! worked. Upgrading the jsdom and xmlhttprequest didn't help me.

@alexknutson
Copy link

NeverI's hack worked for me too.

@rutaihwa
Copy link

Never's hack works fine. Although i am a bit puzzled how at one time everything worked well and after re-boot and before the hack, it didn't work. But the hack did work.
Thanks guys..

@johnaschroeder
Copy link

@netroy, would you be willing to fork this project with your changes and get it up on npm?

@netroy
Copy link
Contributor

netroy commented Sep 21, 2013

@johnaschroeder https://npmjs.org/package/jquery-loader
do look at the readme, there are some differences.. ( it supports multiple versions of jQuery )

@johnaschroeder
Copy link

Perfect! Thanks for making that available.

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