munshkr / ejs-brunch

Adds EJS template compilation support to Brunch
4 stars 4 forks source link

Error compiling ejs template #3

Open mryarbles opened 7 years ago

mryarbles commented 7 years ago

This is the result of some console.logs I put in trying to figure out why this plugin is failing.

ejs-brunch
=======================
ejs compile { data: '<p>Hello</p>',
  path: 'web/static/templates/template.ejs',
  map: undefined }
=======================
=======================
ejs basePath web/static/templates/template.html.ejs
[ 'web/static/templates/template.html.ejs' ]
[TypeError: Path must be a string. Received undefined]

It turns out baseDir is coming up undefined for some reason. Handlebars-brunch works fine so I don't know why it's not finding the directory...

var baseDir = this.config.watched.find(d => parts.indexOf(d) > -1);
    console.log("baseDir:", baseDir); // "undefined"
mryarbles commented 7 years ago

This is where the problem is:

var parts = filePath.split(path.sep);

path.sep = "\" because I work on windows. But all of our project paths use "/" of course...