[Pkg-javascript-devel] Bug#670312: node-jsdom: example code throws TypeError: undefined is not a function

Brian DeRocher brian at derocher.org
Tue Apr 24 19:34:46 UTC 2012


Package: node-jsdom
Version: 0.2.10+dfsg1-1
Severity: important

Dear Maintainer,

I'm trying to run this simplified example:

var jsdom = require("jsdom");

jsdom.env("http://nodejs.org/dist/", [],
	function(errors, window)
		{
		console.log( 'a' );
		} );

It fails with this error:
$ node bs.js 

/home/usr/lib/nodejs/contextify/contextifyjs.js:7
    var ctx = new ContextifyContext(sandbox);
              ^
TypeError: undefined is not a function
    at Contextify (/home/usr/lib/nodejs/contextify/contextifyjs.js:7:15)
    at Object.createWindow (/home/usr/lib/nodejs/jsdom/browser/index.js:266:3)
    at Object.windowAugmentation (/home/usr/lib/nodejs/jsdom/browser/index.js:26:24)
    at Object.parentWindow (/home/usr/lib/nodejs/jsdom/browser/index.js:568:28)
    at Object.<anonymous> (/home/usr/lib/nodejs/jsdom.js:80:15)
    at /home/usr/lib/nodejs/jsdom.js:168:52
    at Request._callback (/home/usr/lib/nodejs/jsdom.js:272:9)
    at Request.callback (/home/usr/lib/nodejs/request/main.js:119:22)
    at Request.<anonymous> (/home/usr/lib/nodejs/request/main.js:525:16)
    at Request.emit (events.js:67:17)

I aptitude remove node-jsdom and installed it via npm.  Then ran
$ NODE_PATH=/usr/local/lib/node_modules/ node bs.js

Now i get this output.

a

Please upgrade this package.




-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages node-jsdom depends on:
ii  node-contextify  <none>
ii  node-cssom       <none>
ii  node-htmlparser  <none>
ii  node-request     2.9.153-1
ii  nodejs           0.6.14~dfsg1-1

node-jsdom recommends no packages.

node-jsdom suggests no packages.





More information about the Pkg-javascript-devel mailing list