Confounding crashing error after login

51 views
Skip to first unread message

Ryan Cole

unread,
Mar 24, 2015, 7:38:24 AM3/24/15
to keyst...@googlegroups.com
I just tried upgrading to the 3.X version of keystone and the server starts up ok, but after logging in I get a crash with the error

TypeError: Cannot read property 'compare' of undefined


Full stack trace:
TypeError: Cannot read property 'compare' of undefined
  at Promise.<anonymous> (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/lib/session.js:62:20)
  at Promise.<anonymous> (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
  at Promise.emit (events.js:107:17)
  at Promise.emit (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
  at Promise.fulfill (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
  at Promise.resolve (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/lib/promise.js:114:23)
  at Promise.<anonymous> (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:177:8)
  at Promise.emit (events.js:107:17)
  at Promise.emit (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:84:38)
  at Promise.fulfill (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mpromise/lib/promise.js:97:20)
  at /Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/lib/query.js:1400:13
  at model.Document.init (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/lib/document.js:254:11)
  at completeOne (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/lib/query.js:1398:10)
  at Immediate.cb (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/lib/query.js:1155:11)
  at Immediate._onImmediate (/Users/ryan/Documents/agency/little-lexicon-v2/node_modules/keystone/node_modules/mongoose/node_modules/mquery/lib/utils.js:137:16)
  at processImmediate [as _immediateCallback] (timers.js:358:17)

Does this make sense to anyone? It looks like maybe a mongoose problem?

Jed Watson

unread,
Mar 24, 2015, 8:18:26 AM3/24/15
to keyst...@googlegroups.com
Hi Ryan,

Did you update to a specific npm version or the latest master on github? the code in that file has changed quite a bit recently.

- Jed

Ryan Cole

unread,
Mar 24, 2015, 8:41:48 AM3/24/15
to keyst...@googlegroups.com
I probably did something stoopid. 

I was building an app on the older v1.5 generator boilerplate and thought I'd upgrade midway through. My yeoman install is broken (seems a common issue) and I can't update the generators, so I tried to find a pre-built app with the newest release but probably missed updating something or other.

Actually today I did a nuclear uninstall of node and npm so maybe yeoman will behave itself after I reinstall it. :p

All I was actually after was the grouped routing thing that the new express offers. :D And then a whole morning spent in broken dependency hell. D:

I'll try it again form the ground up.

Jed Watson

unread,
Mar 24, 2015, 8:43:51 AM3/24/15
to keyst...@googlegroups.com
Ugh, sounds like a nightmare. What platform are you on?

Let me know if you still have trouble after the nuclear option, the new generator is highly recommended for v0.3

Ryan Cole

unread,
Mar 24, 2015, 9:00:29 AM3/24/15
to keyst...@googlegroups.com
I'm on OSX, but only 10.7 which I fear is the root of this mess. Also I somehow don't have Xcode installed and can't install an older version because apple are fascists. ;)

So the generator works up to a point and then dies like this :::
xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
Error: /usr/bin/xcode-select returned unexpected error.

xcode-select: Error: No Xcode folder is set. Run xcode-select -switch <xcode_folder_path> to set the path to the Xcode folder.
Error: /usr/bin/xcode-select returned unexpected error.

No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

  CXX(target) Release/obj.target/binding/binding.o
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: error: unrecognized command line option "-stdlib=libc++"
make: *** [Release/obj.target/binding/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 11.4.2
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/ryan/Documents/agency/node_modules/node-sass
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
Build failed
npm ERR! Darwin 11.4.2
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! node...@1.0.3 install: `node build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node...@1.0.3 install script 'node build.js'.
npm ERR! This is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node build.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ryan/Documents/agency/npm-debug.log


So it looks like this node-sass module is trying to use node-gyp which somehow blows up. :D

Jed Watson

unread,
Mar 24, 2015, 9:15:39 AM3/24/15
to keyst...@googlegroups.com
node-gyp is the build tool which uses Xcode tools to compile from source. Unfortunately, you really need that to work or many node modules won't be able to run.

Ryan Cole

unread,
Mar 24, 2015, 9:22:11 AM3/24/15
to keyst...@googlegroups.com
ugh.Ya ok I'll finally upgrade to mavricks tonight. I'm just afraid that my cca 2013 macbook pro will turn into a creaky old man. :D

There seems to be some inconsistency in the way that NPM delivers modules. Some people claim that everything going on during an npm install should already be precompiled. 

It just odd I've never bumped into this issue before after using node for more than a year and a half. :p

Oh well. 

Thanks!

Ryan Cole

unread,
Mar 25, 2015, 3:02:49 AM3/25/15
to keyst...@googlegroups.com
OK so even after an OS upgrade and installation of xcode I STILL get the same errors. Ugh.

I'm wondering anyways, would it be possible to pull out the sass middleware from keystone? Separate from this issue (though it would solve it) I do prefer to pre-compile CSS rather than have node generate it on the fly.

Is that a big task?

Ryan Cole

unread,
Mar 25, 2015, 3:03:21 AM3/25/15
to keyst...@googlegroups.com
It might even be interesting to offer that as an option in the generator, as I'm sure I'm not the only one.

Ryan Cole

unread,
Mar 25, 2015, 3:10:57 AM3/25/15
to keyst...@googlegroups.com
oh haha is it just a simple as removing the sass line in the config in keystone.js?

Ryan Cole

unread,
Mar 25, 2015, 3:20:16 AM3/25/15
to keyst...@googlegroups.com
OK I've now seen complaints about this node-sass library failing build all over the place in completely different projects and on different OSs. I'm pretty sure the version included in Keystone is not compatible with node 0.12. :p

That would explain my issue too I think.

I'll try bumping up to node-sass 2.0.1 and see if that fixes it.

Ryan Cole

unread,
Mar 25, 2015, 5:00:15 AM3/25/15
to keyst...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages