angular icon indicating copy to clipboard operation
angular copied to clipboard

module fails to load in upcoming node 0.12 release

Open metamatt opened this issue 9 years ago • 1 comments

I checked out the 0.12 branch from the nodejs source repo and built it (it reports its version as 0.11.14-pre).

Using the resulting node binary, require('angular') (using 1.2.23 of this module installed from npm) throws a TypeError:

magi@ubuntu ~/s/d> node
> require('angular')
TypeError: Cannot set property length of [object Object] which has only a getter
    at DocumentFragment.core.Node.insertBefore (/home/magi/src/test/node_modules/angular/node_modules/jsdom/lib/jsdom/level1/core.js:553:30)
    at DocumentFragment.<anonymous> (/home/magi/src/test/node_modules/angular/node_modules/jsdom/lib/jsdom/level2/events.js:332:20)
    at DocumentFragment.proto.(anonymous function) [as insertBefore] (/home/magi/src/test/node_modules/angular/node_modules/jsdom/lib/jsdom/utils.js:23:26)
    at DocumentFragment.core.Node.appendChild (/home/magi/src/test/node_modules/angular/node_modules/jsdom/lib/jsdom/level1/core.js:671:17)
    at jqLiteBuildFragment (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:2330:20)
    at jqLiteParseHTML (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:2364:10)
    at Object.JQLite (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:2383:26)
    at forEach.prepend (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:3000:15)
    at Object.JQLite.(anonymous function) [as prepend] (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:3112:17)
    at eval (eval at <anonymous> (/home/magi/src/test/node_modules/angular/custom.js:14:3), <anonymous>:21956:88)

The actual exception comes from inside https://github.com/tmpvar/jsdom code, and I suspect using a newer version of jsdom might help.

The package.json in the angular npm module requests ~0.8.8 of jsdom, and is currently getting 0.8.11. I changed node_modules/angular/package.json to ask for ~1.0 of jsdom, and it gets 1.0.0-pre.6, and this seems to work better; at least, require('angular') works from the REPL with my "node 0.12" binary.

Assuming jsdom ~1.0 works for this module's purposes under node 0.10 as well, it might be a good time to upgrade?

metamatt avatar Sep 08 '14 20:09 metamatt

this fails in v0.11.14

boneskull avatar Sep 27 '14 10:09 boneskull