title: Partials not found in hbs - express.js
body: <p>Im trying to include hbs partials on my main.hbs but im getting an error that partials could not be found. Here is the code i have on the server.js</p>
  
  <pre><code>const express = require("express");
  const hbs = require("hbs");
  
  const port = process.env.PORT || 3000;
  var app = express();
  
  hbs.registerPartials(__dirname + "/views/partials");
  app.set("view engine", "hbs");
  app.use(express.static(__dirname + "/public"));
  
  
  //
  app.get("/",(req, res) =&gt; {
      res.render("main.hbs");
  })  
  </code></pre>
  
  <p>My folders structure looks like this</p>
  
  <pre><code>JS PROJECT 
      |__views
          |__partials
              |__htmlfooter.hbs   
              |__htmlheader.hbs
          |__main.hbs 
  </code></pre>
  
  <p>... On the main.hbs i have</p>
  
  <pre><code>{{&gt; htmlheader}}
  &lt;h1&gt;test&lt;/h1&gt;
  {{&gt; htmlfooter}}
  </code></pre>
  
  <p>When i start the server and hit that route i get the error:</p>
  
  <pre><code>Error: /Users/sansol/Projects/Web_Dev/JS_Project/views/main.hbs: The partial htmlheader could not be found
      at Object.invokePartial (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:266:11)
      at Object.invokePartialWrapper [as invokePartial] (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:68:39)
      at Object.eval [as main] (eval at createFunctionContext (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js:254:23), &lt;anonymous&gt;:5:31)
      at main (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:173:32)
      at ret (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/runtime.js:176:12)
      at ret (/Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:525:21)
      at /Users/sansol/Projects/Web_Dev/JS_Project/node_modules/hbs/lib/hbs.js:63:19
      at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:511:3)
  </code></pre>
  
  <p>What am i doing wrong?</p>
  
  <p>Thanks</p>