Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
braco opened this Issue · 3 comments

2 participants

@braco
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

$ npm list | grep zappa

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

@braco

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
Owner

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

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.