kirbysayshi/vash

Gettin error "Object is not a function..." when using @html.extend

Closed this issue · 4 comments

I have a layout.vash and index.vash in the same folder (i.e. they are siblings). The content of the files is as follows:

vash

Error: Problem while rendering template at line 4, character 5. Original message: object is not a function. Context: 2 | @html.block('content', function(model){ 3 |

Welcome to

> 4 | }) 5 | })

@venelinpetrov could you try installing vash via npm install --save vash@beta, and post any problems you have here? The beta version attempts to make these errors more clear.

Thank you for the response. Here is the error and the stack trace after installing the mentioned version:

TypeError: Property 'engine' of object # is not a function
at View.render (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\view.js:76:8)
at Function.app.render (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\application.js:527:10)
at ServerResponse.res.render (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\response.js:900:7)
at module.exports (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\app.js:54:9)
at Layer.handle_error (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\layer.js:58:5)
at trim_prefix (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\index.js:268:13)
at proto.handle.c (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\index.js:237:9)
at Function.proto.process_params (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\index.js:312:12)
at proto.handle.c (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\index.js:228:12)
at Function.match_layer (C:\Users\veni\documents\visual studio 2012\Projects\NodeExpressHomework\NodeExpressHomework\node_modules\express\lib\router\index.js:295:3)

Are you able to replicate the same issue at your end using the setup and code from the screenshot? If you need more info I'll do my best to provide such, but the scenario is really simple (i.e. directly taken from the documentation).

Thanks again.

I think this is a misconfiguration of express, not vash. Could you post your express config, specifically the part where you register vash as the view engine?

Ok, I haven't heard anything in several months. I'm going to close this issue. If you are still having troubles or want to provide more info, please reopen!