Reputation: 690
I get this error when trying to set up inheritance in dust.js:
500 Error: ENOENT, open 'C:\Users\Gilbert\Documents\GitHub\maths4me\base.dust'
I have a file called index.html:
{>"base.dust"/}
{<title}Hi{/title}
Which calls base.dust:
<!DOCTYPE html>
<html>
<head>
<title>{+title}Maths 4 me{/title}</title>
<link rel='stylesheet' href='/stylesheets/style.css' />
</head>
<body>
<h1>Hi</h1>
<p>Welcome to maths4me</p>
</body>
</html>
Upvotes: 6
Views: 7090
Reputation: 1683
ENOENT
means that file doesn't exist.
Check again that base.dust
exists in provided location.
Upvotes: 3
Reputation: 1
Double check your names of your files. For me, I have seen this error Error: ENOENT, and I noticed that in one my main app.js, I wrote
app.get('/', function(req, res) {
res.sendfile('./views/plan.html');
});
when I in views folder,I renamed it to home.html, This error appears accordingly
Upvotes: 0
Reputation: 877
If you like me don't want to specify full paths to base templates and partials all the time, try out: klei-dust. (it's like consolidate but only for dustjs-linkedin) In your scenario above you could just specify:
{>base/}
Instead of:
{>"views/base.dust"/}
...to get it to work.
Upvotes: 0
Reputation: 690
Dust partials look in the app root not the views folder, It took me some time to realise this. I was referencing a file in the wrong folder. My code should have been:
{>"/views/base.dust"/}
{<title}Hi{/title}
Upvotes: 0