question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

View engine view path results to default after set manually

See original GitHub issue

app.set(‘views’, path.join(__dirname, ‘views’)); app.set(‘view engine’, ‘pug’);

This does not work, path still points to Failed to lookup view “admin/objects/list” in views directory “/tmp/backend/views” but should /tmp/backend/src/views as __dirname = /tmp/backend/src

Temporary fix is to uncomment default configuration resolve(‘views’) command.

app.defaultConfiguration = function defaultConfiguration() {
  ...
  // default configuration
  this.set('view', View);
  **//this.set('views', resolve('views'));
  this.set('jsonp callback name', 'callback');
};
"dependencies": {
    "app-module-path": "^2.1.0",
    "body-parser": "^1.15.2",
    "chai": "^3.5.0",
    "debug": "^2.3.2",
    "express": "^4.14.0",
    "install": "^0.8.2",
    "is-my-json-valid": "^2.15.0",
    "lowdb": "^0.14.0",
    "mocha": "^3.1.2",
    "npm": "^4.0.3",
    "path": "^0.12.7",
    "pug": "^2.0.0-beta6",
    "socket.io": "^1.5.1",
    "uuid": "^3.0.0",
    "winston": "^2.3.0"
  }

Full code

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
akotulucommented, Jan 6, 2017

Ok, no hurries. If you want I can try and describe issue here. I created the sample project so you can just “npm start” and go to /admin/objects url and it displays Failed lookup view message.

0reactions
dougwilsoncommented, Mar 27, 2022

Hi, I know this is a really old issue, but I am looking through them to help clean them up. It seems the ZIP is no longer available, though. I’m going to close this for now, but if anyone is still having this issue, please open a new issue with a full reproduction case and we’ll take a fresh look.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does setting view engine in ExpressJS cause res.render ...
Yes, that will make render look in 'views' ... settings it will tell you the default setting for view is process.cwd() + '/views'....
Read more >
Circular View Path Error
In this tutorial, we'll look at how we get and resolve Circular View Path errors in a Spring MVC application.
Read more >
How to: Render ASP.NET MVC Razor Views to Strings
The RenderViewToString() method works by receiving a controller context and virtual view path (i.e., ~/views/item/page.cshtml ) and optional ...
Read more >
Use Controllers and Views to Implement a Listing/Details UI
Implementing the "NotFound" View Template​​ View templates by default have two "content regions" where we can add content and code. The first ...
Read more >
Customize pipeline configuration - GitLab Docs
Everyone With Access: Non-project members can also view pipelines. ... In GitLab versions 14.7 and later, newly created projects have a default git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found