Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failed to lookup view #7

Closed
rhythmicdevil opened this issue Jul 30, 2012 · 2 comments
Closed

Error: Failed to lookup view #7

rhythmicdevil opened this issue Jul 30, 2012 · 2 comments

Comments

@rhythmicdevil
Copy link

Hello,
trying to get Kiwi and Express setup. I followed the "out of the box" setup as shown but I am getting an error. I am hoping you can help me out.

Here is my main file:

/*

  • Create the server object
    /
    var Server = Express.createServer();
    //Server.set("views", __dirname + '/' + Config.pathToViews);
    Server.set("view engine", "kiwi");
    /
    *
  • Setup a route for main page
  • http://:<port/
  • */
    Server.get('/', function(req, res){
    res.render('index', {});
    });

Server.listen(Config.server.port); // Start the party

Here is the content of my views directory:

[swright@swright-dev control_panel]$ ll views/
total 4
-rwxr--r-- 1 swright swright 16 Jul 30 12:53 index
[swright@swright-dev control_panel]$

Here is the error output:

Error: Failed to lookup view "index"
at Function.render (/home/swright/code/noschema/control_panel/node_modules/express/lib/application.js:493:17)
at ServerResponse.render (/home/swright/code/noschema/control_panel/node_modules/express/lib/response.js:676:7)
at /home/swright/code/noschema/control_panel/app.js:24:9
at callbacks (/home/swright/code/noschema/control_panel/node_modules/express/lib/router/index.js:165:11)
at param (/home/swright/code/noschema/control_panel/node_modules/express/lib/router/index.js:139:11)
at pass (/home/swright/code/noschema/control_panel/node_modules/express/lib/router/index.js:146:5)
at Router._dispatch (/home/swright/code/noschema/control_panel/node_modules/express/lib/router/index.js:173:4)
at Object.router as handle
at next (/home/swright/code/noschema/control_panel/node_modules/express/node_modules/connect/lib/proto.js:190:15)
at Object.expressInit [as handle] (/home/swright/code/noschema/control_panel/node_modules/express/lib/middleware.js:31

@pierreis
Copy link
Member

Yeah. Just rename your template to "index.kiwi", and it should work as expected.

FYI, this error is thrown by Express, not by Kiwi. ;)

@rhythmicdevil
Copy link
Author

Doh! Sorry man I should have figured that out. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants