exception needs a 'context' argument #432

framlin opened this Issue Apr 6, 2012 · 4 comments


None yet
3 participants

framlin commented Apr 6, 2012


what do I wrong, if I get the following exception? Where to to put that context - object?

If I run my code on my localhost, everything is running fine. Where may be the diffrence to my productin-server? Should be same code, because its git-clonded ......

TypeError: needs a 'context' argument.
at Object.getGlobal (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom/browser/index.js:26:21)
at Object.createWindow (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom/browser/index.js:308:23)
at Object.windowAugmentation (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom/browser/index.js:63:24)
at Object.parentWindow (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom/browser/index.js:605:28)
at Object. (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom.js:81:15)
at /home/framlin/www/framlin/node_modules/jsdom/lib/jsdom.js:170:52
at Request._callback (/home/framlin/www/framlin/node_modules/jsdom/lib/jsdom.js:275:9)
at Request.callback (/home/framlin/www/framlin/node_modules/jsdom/node_modules/request/main.js:119:22)
at Request. (/home/framlin/www/framlin/node_modules/jsdom/node_modules/request/main.js:525:16)
at Request.emit (events.js:67:17)

framlin commented Apr 6, 2012

thats what I try to do:

router.get('/:id', function (id) {
var me = this;
if ( id !== 'favicon.ico') {
if (!window) {
jsdom.env("http://localhost:8080/", [
function(errors, win) {
window = win;
win: window,
logger: winston,
server: true
requestHandler.call(me, id);
} else {
requestHandler.call(me, id);
} else {
//handle favicon

SunboX commented Apr 11, 2012

please fix this :/

maxlk commented May 8, 2012

I get the same error on my localhost.
I get this problem with jsdom 0.2.11 0.2.12 and 0.2.13 With version 0.2.14 I get #436
I guess that both issues is because I don't have contextify (do you have it on your production env?)

jsdom claims contextify to be optionalDependency, but it seems that it is not optional

framlin commented May 8, 2012

I have reinstalled the whole thing from scratch and now it is runing

@framlin framlin closed this May 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment