Always errors - The "path" argument must be one of type string, Buffer, or URL. Received type undefined

2.7k Views Asked by At

I've made a bunch of changes to my app that I didn't think had anything to do with mustache, and suddenly every single page I try to render gives this error.

The "path" argument must be one of type string, Buffer, or URL. Received type undefined
at Object.readFile (fs.js:297:3)
at read (/home/malcolm/complice/node_modules/hogan-express/hogan-express.js:32:14)
at renderPartials (/home/malcolm/complice/node_modules/hogan-express/hogan-express.js:58:7)
1

There are 1 best solutions below

0
MalcolmOcean On BEST ANSWER

Aha, turns out I was still trying to include an old partial. So my code looked something like below. It had broken when I deleted oldpage.mustache and worked fine again when I removed the oldpage line from below.

var partials = {
  'login_form': 'login_form',
  'analytics': 'analytics',
  'oldpage': 'oldpage',
}
app.set('partials', partials)   // define partials available to all pages