Skip to content

TypeError: Property 'engine' of object #<View> is not a function #52

Open
braco opened this Issue Nov 24, 2012 · 3 comments

2 participants

@braco
braco commented Nov 24, 2012
TypeError: Property 'engine' of object #<View> is not a function
    at View.render (/home/c/node_modules/zappajs/node_modules/express/lib/view.js:75:8)
    at Function.app.render (/home/c/node_modules/zappajs/node_modules/express/lib/application.js:505:10)

Just did npm update and am now getting that ^, even using the following zappajs example:


    @set 'view engine': 'eco'

    @get '/': -> @render index: {foo: 'bar', title: 'Eco template'}
    @get '/jade': -> @render 'index.jade': {foo: 'bar', title: 'Jade template'}

    @view index: '''
      <h1><%= @title %></h1>
      <p><%= @foo %></p>
    '''

    @view layout: '''
      <!DOCTYPE html>
      <html>
        <head><title><%= @title %></title></head>
        <body><%- @body %></body>
      </html>
    '''

    @view 'index.jade': '''
      h1= title
      p= foo
    '''

    @view 'layout.jade': '''
      !!! 5
      html
        head
          title= title
        body!= body
    '''
@braco
braco commented Nov 24, 2012

$ npm list | grep zappa

├─┬ zappajs@0.4.12
├── zappajs-partials@0.0.7

@braco
braco commented Nov 24, 2012

Seems to be fixed with

    @app.engine 'eco', require('consolidate').eco 
    @use 'partials'

(via Stephane at https://groups.google.com/d/msg/zappajs/Xilc-PoBVPk/dMqVpN2KhVUJ)

@shimaore
ZappaJS member
shimaore commented Dec 5, 2012

This is a good reminder that I need to finish adding all the examples to the test suite.

@shimaore shimaore added a commit that referenced this issue Dec 5, 2012
@shimaore shimaore Corrected `eco` example (#52) aff203e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.