Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

exception needs a 'context' argument #432

Closed
framlin opened this Issue · 4 comments

3 participants

@framlin

Servus,

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

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/", [
'js/libs/jquery-1.7.1.min.js',
],
function(errors, win) {
window = win;
Framlin.init({
win: window,
logger: winston,
server: true
});
Framlin.stylePage();
requestHandler.call(me, id);
}
);
} else {
requestHandler.call(me, id);
}
} else {
//handle favicon
}
});

@SunboX

please fix this :/

@maxlk

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

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

@framlin framlin 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.