Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Cannot read property 'prototype' of undefined #127

ramstein74 opened this Issue · 13 comments

4 participants


Today i tried to run a simple app to test zappa but after
npm install express
npm install zappa

i goto windows console with node

i get the error
Cannot read property 'prototype' of undefined
zappa.js (65:15)



Zappa has not been updated by mauricemach for a long long time, now you should use instead. You just have to replace require('zappa') by require('zappajs') and npm install zappajs instead of npm install zappa

For me, it solved this issue.


ok, working now.
Other question, about inline views.
How to use inline views from other coffeescript files?

Thanks again


What do you mean by inline views? Do you mean including views from coffeecup files?


To include coffeecup view, it's very simple:
@get '/': -> @render 'index'
It will load the file inside the views sub directory.


In your file, just put this: (without @view vista1: ->)

doctype 5
    html ->
      head ->
        title 'vista inline layout'
      body ->
        h1 'vista inline layout'

and display it with @render 'vista1'

If you want to use a layout, create a file views/ containing this:

doctype 5
    html ->
      head ->
        title 'vista inline layout'
      body ->

and a view views/ containing:

h1 'vista inline layout'

Then render it with @render 'index' and it should have the same display.

You can find more information here:

Good luck ;-)


Hello again
another problem with zappa( i guess)
in my external layout file in jade

!!! 5

  title Jadeout

h1 JadeOut
!= body

Without the 3 line that import the javascript files it works ok but with those 3 lines i get the error
ENOENT, no such file or directory 'C:\testzappa\views\ee500cc8-fe5a-456c-959f-da3dcbb54f63\jadeout.jade'

Is this related to how zappa reads the jade file?

Thank you once more


never mind i did it another way around.

Next issue

in the sample file i try to use backbone js and in the client section code:
i try
$ =>
class Task extends Backbone.Model
i can see from my browser console that backbone is loaded but if i try in browser console
var task= new Task;
i get

Task is not defined...

why is that?

thank you


@ramstein74 coffee script automatically closures your code, so Task is only defined inside that closure. Try to define it as window.Task. If you have any more questions the repo has moved here.


Meanwhile (until the compatibility fork is merged), the package zappa could be labelled as incompatible with Node 0.8.x (or whatever) in the package.json per

You can specify the version of node that your stuff works on:

{ "engines" : { "node" : ">=0.1.27 <0.1.30" } }


@matt-hickford this project is not maintaned anymore, the zappajs fork is maintaned and works with 0.8.

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.