errors in basic_yql example (getting-started-guide/part2) #547

dmitris opened this Issue Sep 24, 2012 · 6 comments

4 participants


Getting an error in the example in the getting-started-guide part2 - basic_yql.

After "mojito start" and going to http://localhost:8666/flickr or http://localhost:8666/pineapples, getting an error:

MOJITO qeperf: constructing action context
MOJITO mojito-action-context: ActionContext created for "flickr/index"
MOJITO qeperf: action context created, executing action "index"
"query": {
"count": 0,
"created": "2012-09-24T09:22:11Z",
"lang": "en-US",
"results": null

var rawPhotos =,
TypeError: Cannot read property 'photo' of null
at Object. (/Users/dmitris/dev/hack/mojito/examples/getting-started-guide/part2/basic_yql/mojits/Flickr/models/model.server.js:29:57)
at Object. (
at Function._exec (/Users/dmitris/.nvm/v0.6.21/lib/node_modules/mojito/node_modules/yui/yui-nodejs/yui-nodejs.js:3735:15)
at Request._callback (/Users/dmitris/.nvm/v0.6.21/lib/node_modules/mojito/node_modules/yui/yui-nodejs/yui-nodejs.js:3759:27)
at Request.callback (/Users/dmitris/.nvm/v0.6.21/lib/node_modules/mojito/node_modules/yui/node_modules/request/main.js:119:22)
at Request. (native)
at Request.emit (events.js:70:17)
at Request. (/Users/dmitris/.nvm/v0.6.21/lib/node_modules/mojito/node_modules/yui/node_modules/request/main.js:521:16)
at Request.emit (events.js:67:17)

A teammate was able to replicate the error.

Yahoo Inc. member

I am the teammate who works with Dmitry. It looks like the api_key has already expired (when debug in YQL). Would that be a useful feature if Mojito could tolerant JS error, e.g. having the try catch block in the main function instead of letting arbitrary random error halting the whole server?


thanks for the heads up. I believe @lzhan fixed this just now with yahoo/mojito#550


@yukinying I agree, that example code is not production quality code.


The API key works, but the example still does not due to missing file mojits/Flickr/views/bar.hb.html If I add that file, it looks ok - not sure what exactly was supposed to go in that view.

The bar view is called in controller.server.js

         ac.done({images: images}, {view: {name: 'bar'}});

Thanks for filing the issue! I've added the missing 'bar.hb.html' template so that the app works.

@zhouyaoji zhouyaoji closed this Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment