visionmedia/jade — Issue #463: Debugging jade rendering
Author: pvencill
Created: 2012-01-04 21:45:55+00:00
State: open

Working on a template, I am getting a weird error in the middle of some divs

6| form(action='/search')
7| #sbar
> 8| #sbx
9| input(type='text',name='q',value=query)
10| input(type='submit',value='Go')
11| #adv

Cannot read property 'length' of undefined, err=undefined)

Not having any idea why that is invalid, I tried following the screencast TJ posted http://www.screenr.com/CV0 which included a blurb about rendering a file. What I don't understand is where the 'options' get turned into variables for the view. I can do this:

jade.renderFile(__dirname+'/../views/index.jade', {debug:true, locals:data}, function(str,err){/* etc */}

And the properties on 'data' will be undefined in the template, but if I do:

jade.renderFile(__dirname+'/../views/index.jade', self:data, function(str,err){/* etc */}

they are properly defined, but of course I don't get the debug output.

Any help?