Skip to content

Instantly share code, notes, and snippets.

@tj
Forked from Fuitad/gist:1368444
Created November 15, 2011 21:42
Show Gist options
  • Save tj/1368460 to your computer and use it in GitHub Desktop.
Save tj/1368460 to your computer and use it in GitHub Desktop.
Jade debugging
debug> run
debugger listening on port 5858connecting... ok
breakpoint #1 in #<Object>.[anonymous](exports=#<Object>, require=function require(path) {
return Module._load(path, self);
}, module=#<Module>, __filename=/Volumes/Fuitad/Documents/www/app.js, __dirname=/Volumes/Fuitad/Documents/www), /Volumes/Fuitad/Documents/www/app.js:1
(function (exports, require, module, __filename, __dirname) { var conf = require('./conf'),
^
debug> continue
debug> Express server listening on port 3000 in development mode
break in [anonymous](req=#<IncomingMessage>, res=#<ServerResponse>, function callbacks(err) {
var fn = route.callbacks[i++];
try {
if ('route' == err) {
nextRoute();
} else if (err && fn) {
if (fn.length < 4) return callbacks(err);
fn(err, req, res, callbacks);
} else if (fn) {
fn(req, res, callbacks);
} else {
nextRoute(err);
}
} catch (err) {
callbacks(err);
}
}), /Volumes/Fuitad/Documents/www/app.js:208
debugger;
^
debug> print err
{ handle: 2, type: 'undefined', text: 'undefined' }
debug> step
break in [anonymous](req=#<IncomingMessage>, res=#<ServerResponse>, function callbacks(err) {
var fn = route.callbacks[i++];
try {
if ('route' == err) {
nextRoute();
} else if (err && fn) {
if (fn.length < 4) return callbacks(err);
fn(err, req, res, callbacks);
} else if (fn) {
fn(req, res, callbacks);
} else {
nextRoute(err);
}
} catch (err) {
callbacks(err);
}
}), /Volumes/Fuitad/Documents/www/app.js:210
res.render('index', {
^
debug> step
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:310
if ('function' == typeof opts) {
^
debug> print opts
{ layout: 'layout/layout-index.jade' }
debug> step
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:315
return this._render(view, opts, fn, parent, sub);
^
debug> step
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:333
var options = {}
^
debug> step
break in #<HTTPServer>.set(setting=view options, val=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/http.js:438
if (val === undefined) {
^
debug> step
break in #<HTTPServer>.set(setting=view options, val=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/http.js:439
if (this.settings.hasOwnProperty(setting)) {
^
debug> step
break in #<HTTPServer>.set(setting=view options, val=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/http.js:440
return this.settings[setting];
^
debug> step
break in #<HTTPServer>.set(setting=view options, val=undefined) returning #<Object>, /Volumes/Fuitad/Documents/www/node_modules/express/lib/http.js:448
};
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:339
, root = app.set('views') || process.cwd() + '/views';
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:342
var cid = app.enabled('view cache')
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:344
: false;
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:347
if (viewOptions) merge(options, viewOptions);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:347
if (viewOptions) merge(options, viewOptions);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:350
if (this._locals) merge(options, this._locals);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:353
if (opts) merge(options, opts);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:353
if (opts) merge(options, opts);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:356
if (opts && opts.locals) merge(options, opts.locals);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:359
if (options.status) this.statusCode = options.status;
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:362
options.attempts = [];
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:364
var partial = options.isPartial
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:368
if (true === layout || undefined === layout) {
^
debug> print layout
layout/layout-index.jade
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:373
options.scope = options.scope || {};
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:376
options.parentView = parent;
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:379
options.root = root;
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:382
options.defaultEngine = app.set('view engine');
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:385
if (options.charset) this.charset = options.charset;
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:388
if (false !== options.dynamicHelpers) {
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:390
if (!this.__dynamicHelpers) {
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:391
this.__dynamicHelpers = {};
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:392
for (var key in dynamicHelpers) {
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:393
this.__dynamicHelpers[key] = dynamicHelpers[key].call(
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:401
merge(options, this.__dynamicHelpers);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:405
union(options, helpers);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:408
options.partial = function(path, opts){
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:413
options.hint = app.enabled('hints');
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:414
view = exports.compile(view, app.cache, cid, options);
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:417
options.layout = function(path){
^
debug> next
break in #<ServerResponse>._render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:422
var str = view.fn.call(options.scope, options);
^
debug> next
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:318
if (fn) {
^
debug> next
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:321
} else if (sub) {
^
debug> next
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined), /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:325
this.req.next(err);
^
debug> next
500 '/Volumes/Fuitad/Documents/www/views/index.jade:1\n > 1| extends layout/layout-index\n 2| \n 3| block content\n 4| div(class=\'grid_14 prefix_1 suffix_1\')\n\nCannot read property \'filename\' of undefined'
TypeError: /Volumes/Fuitad/Documents/www/views/index.jade:1
> 1| extends layout/layout-index
2|
3| block content
4| div(class='grid_14 prefix_1 suffix_1')
Cannot read property 'filename' of undefined
at anonymous (eval at <anonymous> (/Volumes/Fuitad/Documents/www/node_modules/jade/lib/jade.js:161:8))
at Object.<anonymous> (/Volumes/Fuitad/Documents/www/node_modules/jade/lib/jade.js:166:12)
at ServerResponse._render (/Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:422:21)
at ServerResponse.render (/Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:315:17)
at /Volumes/Fuitad/Documents/www/app.js:210:7
at callbacks (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:272:11)
at param (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:246:11)
at pass (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:253:5)
at Router._dispatch (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:280:4)
at Object.handle (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:45:10)
ReferenceError: sendHttpError is not defined
at Object.<anonymous> (/Volumes/Fuitad/Documents/www/app.js:103:11)
at Object.handle (/Volumes/Fuitad/Documents/www/node_modules/express/lib/http.js:193:10)
at IncomingMessage.next (/Volumes/Fuitad/Documents/www/node_modules/express/node_modules/connect/lib/http.js:198:17)
at ServerResponse.render (/Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:325:16)
at /Volumes/Fuitad/Documents/www/app.js:210:7
at callbacks (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:272:11)
at param (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:246:11)
at pass (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:253:5)
at Router._dispatch (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:280:4)
at Object.handle (/Volumes/Fuitad/Documents/www/node_modules/express/lib/router/index.js:45:10)
break in #<ServerResponse>.render(view=index, opts=#<Object>, fn=undefined, parent=undefined, sub=undefined) returning undefined, /Volumes/Fuitad/Documents/www/node_modules/express/lib/view.js:328
};
^
debug>
@tj
Copy link
Author

tj commented Nov 15, 2011

ah so you are using extends, hmm.. it should be including the filename here https://github.com/visionmedia/express/blob/2.x/lib/view.js#L63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment