Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

jQuery doesn't work on node 0.10.0 #52

Closed
skerit opened this Issue · 14 comments
@skerit

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)

@jschliffer

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

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)

@gorillamania

Having the same problem

@0xsven

Me too! Any idea?

@gorillamania

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

@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

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

@coolaj86
Owner

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

@kishoremaley

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

@alexknutson

NeverI's hack worked for me too.

@rutaihwa

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

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

@netroy

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

@johnaschroeder
@arnorhs arnorhs referenced this issue in apis-is/apis
Closed

node v0.10 compatibility #76

@mrm007 mrm007 referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mrm007 mrm007 referenced this issue in ranm8/requestify
Closed

jQuery doesn't work on node 0.10.x #9

@coolaj86 coolaj86 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.