saymedia / angularjs-server

Specialized server for AngularJS sites
MIT License
248 stars 49 forks source link

Example Broken #27

Open daslicht opened 8 years ago

daslicht commented 8 years ago

When i run the example and visit localhost:3000 I get the following output in the console :

daslicht:weather daslicht$ node server.js
Listening on port 3000
/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/level1/core.js:662
    Array.prototype.splice.call(this._childNodes, oldChildIndex, 1);
                           ^
TypeError: Cannot set property length of [object Object] which has only a getter
    at core.Node.removeChild (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/level1/core.js:662:28)
    at null.<anonymous> (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/level2/events.js:370:17)
    at proto.(anonymous function) [as removeChild] (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/utils.js:23:26)
    at null.innerHTML (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/browser/index.js:465:12)
    at createFrom.close (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/node_modules/jsdom/lib/jsdom/browser/index.js:160:40)
    at Object.dispose (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/lib/main.js:233:20)
    at /Users/daslicht/DEV/node/angular/angularjs-server/lib/main.js:28:29
    at runSources (/Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/lib/main.js:55:21)
    at /Users/daslicht/DEV/node/angular/angularjs-server/node_modules/angularcontext/lib/main.js:76:21
    at fs.js:334:14
daslicht:weather daslicht$ 
isuvorov commented 8 years ago

+1

apparentlymart commented 8 years ago

Hmm this error seems to be coming from the guts of jsdom. Possibly it's caused by the fact that angularcontext (the dependency of angularjs-server that itself depends on jsdom) is pinning to ~3.1.2 and I think that old jsdom version isn't compatible with newer versions of node than (IIRC?) 0.10.

Using a newer version of jsdom might help but kinda annoying since it's an indirect dependency, albeit one that I also maintain. Will try to take a look at this at some point, but to be honest it's not a high priority because our app that uses this is still running on the Node 0.10 series right now.

namnm commented 8 years ago

+1. I have the same problem. Any solution?

rjmackay commented 8 years ago

I've managed to get this partially working on my fork https://github.com/rjmackay/angularjs-server/tree/update-angular-context However I think only the initial render is working, further navigation seems to be broken.

pakro commented 8 years ago

@rjmackay current available version on this repo is working for me as long as I add an APPID code as query parameter for the weather API. You can register an account for free and there is a free plan available by default for evaluation purposes.