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
500 Error: Failed to lookup view #2141
Comments
Does |
Edit: express does the lookup, but you provided an absolute file system path with your leading slash. Remove the leading slash and it should work. |
I did it without and with the forward slash the same 500 Error exist. I use swig. I used it with and without consolidate. Same Error exist. |
What version of express are you using? Can you paste the error here you get when you don't use the stash? |
Express 4 (I updated this weekend). Currently not in office, will do at my earliest convenience. |
OK. As far as I can tell from the error in your original post, not including the leading stash will definitely work, assuming a file exists at |
Using it without the forward slash:
Configapp.engine('html', consolidate.swig);
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
app.set('view cache', false); |
Interesting, the error shows that |
Can you paste your |
It is actually trying to print a 500 Error when i comment out the it prints the text version "Something is broken on our end, email us if this issue persist." however the
For some reason the Express is adamant in looking in the errors sub-directory app.use(function(err, req, res, next){
console.log(err);
// we may use properties of the error object
// here and next(err) appropriately, or if
// we possibly recovered from the error, simply next().
res.status(err.status || 500);
// respond with html page
/*if(req.accepts('html')) {
res.render('errors/500.html', {error: 'Something is broken on our end, email us if this issue persist.'});
return;
}*/
// default to plain-text. send()
res.type('txt').send('Something is broken on our end, email us if this issue persist.');
}); |
Yea, this error is not in Only the error |
Ok thanks... noted! |
What is the content of your |
That was the case @dougwilson. Gratitude! |
There is a sub directory in views called errors and within that errors file there is '404.html' and '500.html'. In my app I have which is where the error happens (This is the same thing I had with the previous SWIG which worked fine)....
500 Error: Failed to lookup view "/errors/500.html" in views directory "/home/dc/webapps/app/views"
It isn't going into the subdirectory "errors"!
The text was updated successfully, but these errors were encountered: