Note that there are some explanatory texts on larger screens.

plurals
  1. POIn expressjs, Dustjs Multiple templates not working
    primarykey
    data
    text
    <p>In expressjs, Dustjs Multiple templates not working getting <strong>500 Error: Template Not Found: template</strong></p> <p>my base dust template as below <strong>(template.dust)</strong></p> <pre><code>&lt;div class="page"&gt; {+pageHeader}Hello World!{/pageHeader} &lt;div class="bodyContent"&gt; {+bodyContent/} &lt;/div&gt; &lt;div class="footer"&gt; {+pageFooter} &lt;hr&gt; &lt;a href="/contactUs"&gt;Contact Us&lt;/a&gt; {/pageFooter} &lt;/div&gt; &lt;/div&gt; </code></pre> <p>And I am trying to call this base template inside my home.dust I am getting error as below</p> <pre><code>Express 500 Error: Template Not Found: template at Object.load (C:\office\nodejs-example\express_example\node_modules\application-name\node_modules\dust\lib\dust.js:54:27) at Chunk.partial (C:\office\nodejs-example\express_example\node_modules\application-name\node_modules\dust\lib\dust.js:407:15) at body_0 (undefined:1:130) at Array.0 (C:\office\nodejs-example\express_example\node_modules\application-name\node_modules\dust\lib\dust.js:34:7) at EventEmitter._tickCallback (node.js:192:40) </code></pre> <p><strong>"home.dust"</strong></p> <pre><code>{&gt;"template"/} {&lt;pageHeader} {?username} Welcome {username} &lt;a href="/items"&gt;Items&lt;/a&gt; | &lt;a href='/logout'&gt; Log Out&lt;/a&gt; {:else} &lt;form method="POST" action="/signin"&gt; &lt;label&gt;Usename &lt;input type="text" name="username" id="s-user"&gt;&lt;/label&gt; &lt;input type="submit" class="submit" value="Login"&gt; &lt;/form&gt; {/username} {/pageHeader} </code></pre> <p>routes class method </p> <pre><code>exports.home = function(req, res){ res.render('home', {username : req.session.username}); }; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload